Jump to content

aspnetguy

Members
  • Posts

    6,787
  • Joined

  • Last visited

Everything posted by aspnetguy

  1. I wrote an object to simulate HTMLElement.prototype in all browsersobject var DOMElement = { extend: function(name,fn) { if(!document.all) eval("HTMLElement.prototype." + name + " = fn"); else { // // IE doesn't allow access to HTMLElement // so we need to override // *document.createElement // *document.getElementById // *document.getElementsByTagName // //take a copy of //document.createElement var _createElement = document.createElement; //override document.createElement document.createElement = function(tag) { var _elem = _createElement(tag); eval("_elem." + name + " = fn"); return _elem; } //take copy of //document.getElementById var _getElementById = document.getElementById; //override document.getElementById document.getElementById = function(id) { var _elem = _getElementById(id); eval("_elem." + name + " = fn"); return _elem; } //take copy of //document.getElementsByTagName var _getElementsByTagName = document.getElementsByTagName; //override document.getElementsByTagName document.getElementsByTagName = function(tag) { var _arr = _getElementsByTagName(tag); for(var _elem=0;_elem<_arr.length;_elem++) eval("_arr[_elem]." + name + " = fn"); return _arr; } } } }; Here is some examples of how to use itexample <html><head> <script type="text/javascript" src="DOMElement.js"></script> <script type="text/javascript"> DOMElement.extend("foo",function(){alert('bar')}); DOMElement.extend("about","DOMElement v0.1") DOMElement.extend("contents",function(){return this.innerHTML}) var elem = document.createElement("div"); elem.foo(); onload = function() { var elem2 = document.getElementById("myDiv"); alert(elem2.about); var divs = document.getElementsByTagName("div"); for(var i=0;i<divs.length;i++) alert(divs[i].contents()) } </script></head><body> <div id="myDiv">hi</div> <div id="div2">there</div></body></html>
  2. let me check then...I have it on my web server.EDIT: Nope IE7 won't let me either.
  3. I am finding it hard to understand the things you are saying. To show up out of the blue and begin talking about your browser and want us to use it yet you act arrogant, you belittle web standards, you say you are more innovative then many large companies that have help make the web what it is today, and you won't answer a simple question about how many people have downloaded your browser (most likely because very few have).I hope for your sake you never decide to go into marketing or sales.You have successfully made a horrible impression and personnally don't care if your browser is the best thing ever invented. I would never use it and never recommend anyone I know use it.
  4. Is it that way with IE7 too? Hopefully they will open it up in future versions.
  5. I have no idea what you are talking about. I asked oyu a simple question and you are talking in circles about completely unrelated stuff. So you are a better programmer than everyone at Microsoft, Mozilla, and Opera? Wow oyu have a high opinion of yourself. these companies are focusing on standards compliance and many other features that have been requested.
  6. wow you avoided my question twice. I searched for user reviews of your browser and found none. I also looked at the number of downloads from each of the download sites you advertise on there doesn't seem to be very many, maybe 4 or 5 downloads per site.
  7. the object oyu what to extend is HTMLElement. Unfortunately IE doesn't let you extend it. you will need to create a function that would scan the DOM and attach your function to every element unless you create the dom dynamically using the function I showed earlier.
  8. You can extend the native Element object...many toolkits do it. Maybe you could download Prototype or mootools and look at the source and see how they do it.
  9. you could do something like this (use this function instead of document.createElement) function createElement(tag){ var elem = document.createElement(tag); elem.grandpa = function() { return this.parentNode.parentNode; } return elem;}
  10. hoe many downloads have you had? Are users reporting any bugs?
  11. well you need to design some tables for your database.topics-------------topicIdtopicNametopicContentuserIdreplies-------------replyIdtopicIdreplyContentuserIdusers--------------userIduserNamepasswordthat is a very basic structure for a simple message board system.
  12. Do you know how to read and write from a database?
  13. http://en.wikipedia.org/wiki/XML
  14. It is sounding good...are you going to continue it as a message center or shoot for the debugger? If you're not I think I'll give the debugger a try.
  15. the onerror event captures all script errorshttp://www.w3schools.com/js/js_onerror.asp
  16. and the topic takes a turn for the worst...LOLXML was not created to be a database so it makes sense that a database would be the best choice
  17. lol imagine if your archiver made the slightest mistake in changing the xml...do you want to go debug and fix the xml by hand....ouch!XMl is great for storing configuration settings and other small sets of data but not very practical for large things like blogs/CMS.
  18. aspnetguy

    Simple Login

    login page session_start();//////$pass = $_POST['passwordField'];if ($pass == 'myPassword'){ $_SESSION["login"] = "yes"; $URL = "correctpage.php";}if(isset($_SESSION["login"]) && $_SESSION["login"] == "yes") header ("Location: $URL"); correctpage.php session_start();if(!isset($_SESSION["login"]) || $_SESSION["login"] != "yes") header("Location: login.php");//Session is set so contiue with rest of page////
  19. aspnetguy

    Simple Login

    if the user knows the url of the "protected" page they can just type it in and bypass your login. you need to set sessiosn when they login correctly and check to see if the seesions are correct on every protected page.
  20. I realise why you said to use a database but it sounded like you were saying to only ever use mysql and no other databases.
  21. you cannot put div inside an anchor. Why are you doing this? if you need the anchor to be block then use display:block in your style sheet.
  22. true parsing a small file compared to a large one would be faster but managing that many files would not be fun. Good Luck
  23. aspnetguy

    XHTML & PHP

    I am sure they left it for inputs because W3C knows that many programming languages use it.
  24. read and writing xml files is significantly slower than using a database. What happens when you get to 300 blog entries, you will have 3000 xml files....gross. If you insist on using xml then structure it like sql tables. All entries in one xml file, all comments in one file...Also how will you protect your xml files? If I know the path can I download it? I could take you user/password file and login into your blog as you.There are many reasons not to use XML, although I have considered the idea in hte past as a cross platform/hosting provider solution. In the end practicality won out and I used a database.Just my opinion though.
×
×
  • Create New...