Webworldx
-
Posts
347 -
Joined
-
Last visited
Content Type
Profiles
Forums
Events
Posts posted by Webworldx
-
-
Shouldn't:if(errorMessage.doesExist = 1){ alert(errorMessage.caption);}be:if(errorMessage.doesExist == 1){ alert(errorMessage.caption);}??
-
[sorry for getting off the point of the thread, although I think it's been solved,really]Heh, I read the article and I must say I think even the guys in it are confused! The "for and against" at the end aren't really that conclusive, and i'd lean more towards the "for" side. It's much much faster in parsing in browsers, which I think is the main downer for promoting DOM over it. Why would you want to implement something that runs slower than what you've currently got? I think it's a bit unfair they compare it to "goto" too. I've been using VB for years now, and goto is my pet hate, and an absolute last resort in anything i've ever created! I like innerHTML.. what i don't like is people who try and use it as an absolute string.. like:document.body.innerHTML = document.body.innerHTML.replace(...and expect it to work effectively. I can see their reservations on teaching it to newbies, but it's such a powerful tool, I think it'd be wrong to dismiss it
-
What's wrong with <a id='mg'>School</a>document.getElementById('mg').innerHTML??Edit: I can see Raimo's point above with multiple nodes underneath, and not wanting to use innerHTML.. but it's not bad if there's only going to be a text node in there.
-
Thanks aspnetguy
-
I wrote a nice little snippet for this. Unfortunately Opera doesn't like scrollTop, but it works in Firefox and Internet Explorer http://www.ifcode.com/javascript/scroll_textarea.htmlI've set it to scroll to 98 as an example, but change the number sent to the function to scroll elsewhere.
-
Heh.. now that is stupid. Would it be possible to check server side with the ExecPHP thing to see if a user had modified the data (for instance, check the format the data came in). I suppose that could limit damage?
-
Eep. I wouldn't go rewriting the innerHTML of the body, or appending to it after load.aspnetguy, i've also noticed the rewrite thing, but that's often after the page has loaded and the document has close()'d itself, writing to it would cause a new page to be created.DOM methods are the nicest way, appending to the body or removing that way
-
I really love it mate, great work!
-
I think that's the important bit, really. It's an IE only JScript extension, so you should be looking to use alternative methods (although I know there aren't for some of the more specific execCommands() options.)and it works only with MSIE : so it can't be used seriously in real world -
It's RegExp, looking for a number, which is : \d in the syntax. The slashes before and after are the start and end of the RegExp.I prefer it written as:numcheck = new RegExp(/\d/);
-
it's this line:if ((x=="main.html")||(x=="wishlist.html")||(x=="prodblank.html")||(x=="form.html")||(x=="product1.htm")||(x=="index.html")){ The referrer always returns the FULL url, but you're only equating to a little bit of it.Try:if(x.match(/(main|wishlist|prodblank|form|product1|index).htm/i) != null){
-
XMLHttpRequest might also be useful for this. Not too sure on how ASP implements this though, aspnetguy will probably know more than me
-
I like the remove by index or text, that's quite a cool idea, but most of the other things just seem to be replacing one name for another (e.g. Items.Count and Items.length). I'd like to see the XHTML/CSS version though, have you seen: http://www.easy-designs.net/...replace.../final.html. I think that's a very nice CSS/JS way of creating a box, and you can use keyboard keys if you tab to it too Adding and removing items to that shouldn't be too difficult a job
-
It wouldn't do the numbers after it, and yours would cause the num to go weird.
-
That's okay, glad to be of some help
-
What about something like:http://www.ifcode.com/javascript/order.htmlOr would you prefer drop down menus?
-
something likenew RegExp(/fir(\d+)sec(\d+).gif/i);might be better than the split, but either way
-
http://w3schools.invisionzone.com/index.php?showtopic=3864Read your old topics..
-
Have you tried using file://C:\.. instead of just C:\. Or making the path relative (/folder/file.css) instead of using Javascript? It seems like a problem with the chm compiling rather than a javascript one.
-
Why not make them enter the data in sequential order? Like:
<form id="myForm"><input name="myField1" onBlur="blurHandler();" value="" /><br /><input name="myField2" onBlur="blurHandler();" value="" /><br /><input name="myField3" onBlur="blurHandler();" value="" /><br /></form><script type='text/javascript'> function blurHandler(){ with(document.getElementById('myForm')){ if(myField1.value==""){ myField1.focus(); return; } if(myField2.value==""){ myField2.focus(); return; } if(myField3.value==""){ myField3.focus(); return; } } }</script>
You could also add "Field 2 has not been completed. Would you like to edit it now?" style error messages in so users know what's happening.
-
Have the song open in a popup window instead, and make sure you don't close the popup
-
I'm wondering if Blocked Content actually triggers on @import or CSS behaviour: scripts. See:http://dean.edwards.name/my/misbehaviors/heh. But yes, what Scott says would be a good solution!
-
I wrote my own little version as I thought that website one was a little long, and hadn't done one before. Let me know what you think:
<script type='text/javascript'>/*Date ParserCreated for W3Schools by Blue*/var iDate = "31/01/1962";function check_day_month(mon,year){ var myRegMon = new RegExp("(04||06||09||11)"); if(myRegMon.exec( mon ) && RegExp.$1 != ""){ return '30'; } else if(mon == '02'){ return check_feb(year); } else { return '31'; }}function check_feb(yr){ if( (yr / 4) == Math.floor(yr / 4) ){ return '29'; } else { return '28'; }}function check_date(theDate){ var myRegEx = new RegExp(/\d{2}\/\d{2}\/\d{4}/); if(theDate.length != 10 || myRegEx.test(theDate) == false){ return 'The field must be in the correct format'; } var iSplit = theDate.split(/\//g); iSplit[2] = Math.floor(iSplit[2]); if( Math.floor(iSplit[0]) > check_day_month( iSplit[1] , iSplit[2] ) ){ return 'The number of days set was not correct for the month/year'; } return 'The date was parsed successfully';}var myResult = check_date(iDate);document.write(myResult);</script>
-
Does the Blocked Content message default to <noscript> ? If so, attempt it through CSS in there?
A JS string writing problem
in JavaScript
Posted
I thought i'd target the doXML function specifically and attempt to clean that up, as it seems that's doing a lot of unnecessary stuff. The result i've posted here:http://pastebin.com/687628You should be able to replace your existing one with this.