homepage Welcome to WebmasterWorld Guest from
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Visit PubCon.com
Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
Forum Library, Charter, Moderator: open

JavaScript and AJAX Forum


 3:37 pm on Feb 6, 2002 (gmt 0)

I know I've been posting alot lately about javascript but I'm in the process of learning it. It's getting much esier than it was at the begining of last week. Thank you all for helping me get this far.

Now, heres my question

I'm doing a statement similar to this.
function loadData(placement) {
for (i = placement; i < placement + 10; i++) { // start of for
if (i > placement) {
document.write('<tr><td bgcolor="#666666" align="right"><b><font size="2" face="Verdana, Arial, Helvetica, sans-serif">' + gather_info_date[i] + '</font></b></td></tr>');
document.write('<tr><td align="left" bgcolor="#FFFFFF"><font face="Verdana, Arial, Helvetica, sans-serif" size="2">' + gather_info_content[i] + '</font></td></tr>');
// END
} // end of for

// What is the equivalent of ENDing a script in Javascript?

I'm trying to tell it that if i is greater then placement, stop printing the document.write. I dont know if I'm doing it right or not but most of the code is coming along just great! :)




 6:15 pm on Feb 6, 2002 (gmt 0)

to jump out of a loop (such as a for loop) use:



 6:24 pm on Feb 6, 2002 (gmt 0)

Also worth mentioning here that if you're in a function and you want to leave the function at certain point - i.e. not process the remaining instructions you can return false;.

Global Options:
 top home search open messages active posts  

Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved