JavaScript - Jscript Code Not Loading
For some reason, can't get my script to load with he page. not sure what I'm doing wrong, but I'm so confused.
http://www.rutholsonphoto.com/build-002/index.html Similar Tutorialsfor some reason I can't get this code to load... Code: <script type="text/javascript"> alert("test"); windowBody = document.getElementById("windowBody"); windowBody.style.height = (frameHeight - 250) + "px"; </script> that should load when it loads the file foot.php foot.php should be included onto the bottom of all of my labs (and it is) my labs are opened up with Ajax... but the script its not loading at all... someone help =[ the web site is http://opentech.durhamcollege.ca/~in...rittains/labs/ sorry for the poor description I'm having a hard time describing this error lol This is a class assignment and I can't get it to run. I can't figure out what's wrong. This is most of the script. One part isn't finished yet, but I was still expecting functionality to test. I need to have it load in IE but I can't get it to. Nothing shows up. In Firefox I get the right look but when I click "Run" I don't get a prompt at all. It's not very long. var finalCost; var originalPrice; var markedPrice; var delivery; var tradeIn; var deliveryCharge; var tradeCredit; var discountedPrice; function driverModule_click() // <<< DO NOT CHANGE THIS LINE { // <<< DO NOT CHANGE THIS LINE //================================================================================================== // Module Name: <--- Enter the driver module name from your logic solution. //================================================================================================== //================================================================================================== // Place your code here //================================================================================================== markedPrice = Number( prompt("Please enter the marked price of the bed.", "") ); delivery = prompt("Does the customer need the new bed delivered (Y or N)?", ""); tradeIn = prompt("Does the customer have a trade in (Y or N)?", ""); if(markedPrice > 100) { discountedPrice = markedPrice * .15; } else if(finalScore > 90) { discountedPrice = markedPrice * .14; } if(delivery == "Y" || delivery == "y") { deliveryCharge = 20; } else { deliveryCharge = 0; } if(tradeIn == "Y" || hasExtraCredit == "y") { tradeCredit = 5; } else { tradeCredit = 0; } finalCost = discountedPrice + deliveryCharge - tradeCredit; labelout.value = labelout.value + "The cost to you for the bed is " + finalCost + "\n"; labelout.value = labelout.value + "The original price was " + markedPrice + "\n"; Hi! i am working on a facebook like photo viewer. I have used javascript to declare an array of about 200 images. I have the following approach to pre-load the images. I preload all the images when the page loads: HTML: <body onload = "lodpic()"> JAVASCRIPT: function lodpic() { for(i=0; i<=199; i++) { LODImage = new Image(); LODImage.src = picture[i]; } } The problem is the page tries to load all the images when opened. And when the user clicks "next" to view other photos, the other photo is still loading where as some are already loaded. I would like the code to be able to load the photo that the user is currently viewing as the user gets to that picture, before the page tries to finish loading all the photos. In other words, if the user wants to view a particular photo directly, that photo should get the priority of loading quickly. Or if there are other approaches, it would be really helpful. Thank you! Hello everyone, I am just beginning to learn javascript, and I am trying to create a little game where when a user hovers over a picture it changes, and things like that. At the moment I have been trying to make it so that the pictures tile so they fill the whole page area, dynamically so that it changes depending on the users browser size (px). The images have many attributes so I can't just tile them with css as they need to be actual elements. The problem is the code doesn't run, and I can't work out why. I think all the lines that require it have semi colons and its all correct. Forgive me if the answer is clear but as I said I only just started learning. Anyway, on with the code: Code: <!doctype html> <html lang="en"> <head> <title>Hi, I'm a button.</title> <link rel="stylesheet" type="text/css" href="style.css"> <script type="javascript"> function mainDo() { if (document.body && document.body.offsetWidth) { winW = document.body.offsetWidth; winH = document.body.offsetHeight; } if (document.compatMode=='CSS1Compat' && document.documentElement && document.documentElement.offsetWidth ) { winW = document.documentElement.offsetWidth; winH = document.documentElement.offsetHeight; } if (window.innerWidth && window.innerHeight) { winW = window.innerWidth; winH = window.innerHeight; } document.write('Width = ' + winW + 'Height = ' + winH); winW=winW/127; winH=winH/128; winW=Math.round(winW); winWs=winW; winH=Math.round(winH); winHs=winH; document.write('Width = ' + winW + 'Height = ' + winH); while (winH>0) { while (winW>0) { document.write('<img onMouseover="this.src=\'img/hibutton_orange.png\'" onClick="this.src=\'img/hibutton_green.png\'" ondblClick="this.src=\'img/hibutton_blue.png\'" src="img/hibutton_blue.png">'); winW=winW-1; } document.write('\n' + '<br>'); winW=winWs; winH=winH-1; } } </script> </head> <body onload="maindo()"> </body> </html> I am using this fancy box code to smoothly pop up an image on click, I got it working on my main index page but that's not where I want to put it. My site has a menu where it loads webpages inside the main index one, I would like to use the code on one of those pages but something is not working. I am not able to use the specified DOCTYPE but find that it works all the same with my current one, however if I use the given one in addition to the one I have now (and need) then my site does not work properly, further if I replace it I get the same results. My existing doctype: Code: <DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd" "http://www.w3.org/TR/1999/REC-html401-19991224/loose.dtd" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> What the code uses: Code: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> I'm not sure what the differences are but I've been advised that I need to run the code in "standards mode" before I try to fix it. As I see it the code works, just not where I need it to, nothing unusual on my site and nothing unusual that I may be wrong. On my site you can see at the bottom right a blue text link called "aaaa" this is the code that works, however (clicking the dome to the left of that to scroll the page down and selecting the "met.a has guts" menu option diagram) you'll see the "aaaa" link again at the bottom left of that page and that is where I need it to work from. I even tried using the exact code from the example in that linked .htm page but it doesn't make a difference, it probably even hinders the code as it looks at the main html page. But if loading the page on its own the code will work, so its related to the menu and the way that works. If anybody can help that would be brilliant, I'm sure its something simple. Thanks! hey guys, i know this really hot girl and need to make her think we are right for eachother, to do this i need to 'tweak' a lovetest. i know the love test's answer depends on the number of the letters L,O,V,E,Y,O,U but i need an if function that adds up both name boxes and adds to 100%. here is code: // Made by ADAM - roflmao456 var test = ''; function checkLove(){ var l1 = test.GetControlText('love1'); var l2 = test.GetControlText('love2'); first = l1.toUpperCase(); firstlength = l1.length; second = l2.toUpperCase(); secondlength = l2.length; var LoveCount=0; for (Count=0; Count < firstlength; Count++) { letter1=first.substring(Count,Count+1); if (letter1=='L') LoveCount+=2; if (letter1=='O') LoveCount+=2; if (letter1=='V') LoveCount+=2; if (letter1=='E') LoveCount+=2; if (letter1=='Y') LoveCount+=3; if (letter1=='O') LoveCount+=1; if (letter1=='U') LoveCount+=3; } for (Count=0; Count < secondlength; Count++) { letter2=second.substring(Count,Count+1); if (letter2=='L') LoveCount+=2; if (letter2=='O') LoveCount+=2; if (letter2=='V') LoveCount+=2; if (letter2=='E') LoveCount+=2; if (letter2=='Y') LoveCount+=3; if (letter2=='O') LoveCount+=1; if (letter2=='U') LoveCount+=3; } amount=0; if (LoveCount> 0) amount= 5-((firstlength+secondlength)/2) if (LoveCount> 2) amount= 10-((firstlength+secondlength)/2) if (LoveCount> 4) amount= 20-((firstlength+secondlength)/2) if (LoveCount> 6) amount= 30-((firstlength+secondlength)/2) if (LoveCount> 8) amount= 40-((firstlength+secondlength)/2) if (LoveCount>10) amount= 50-((firstlength+secondlength)/2) if (LoveCount>12) amount= 60-((firstlength+secondlength)/2) if (LoveCount>14) amount= 70-((firstlength+secondlength)/2) if (LoveCount>16) amount= 80-((firstlength+secondlength)/2) if (LoveCount>18) amount= 90-((firstlength+secondlength)/2) if (LoveCount>20) amount=100-((firstlength+secondlength)/2) if (LoveCount>22) amount=110-((firstlength+secondlength)/2) if (firstlength==0 || secondlength==0) amount= "Err"; if (amount < 0) amount= 0; if (amount >99) amount=99; test.SetControlText('loveOutput',amount+"%"); return "[c=12]"+test.GetControlText('love1')+"[/c] + [c=29]"+test.GetControlText('love2')+"[/c] = [c=3]"+amount+"[/c]%"; } function OnGetScriptMenu(){ var ScriptMenu = "<ScriptMenu>"; ScriptMenu += "<MenuEntry Id='lovetest'>"; ScriptMenu += "Love Test"; ScriptMenu += "</MenuEntry>"; ScriptMenu += "</ScriptMenu>"; return ScriptMenu; } function OnEvent_MenuClicked(sMenuId){ if(sMenuId == "lovetest") {test = MsgPlus.CreateWnd("windows.xml","tester");} } function sendResult(){ for (var e = new Enumerator(Messenger.CurrentChats); !e.atEnd(); e.moveNext()){ if(test.GetControlText('love1')){ if(test.GetControlText('love2')){ e.item().SendMessage(checkLove()); } else { MsgPlus.DisplayToast("Love Test","Please enter in something in box 2."); } } else { MsgPlus.DisplayToast("Love Test","Please enter in something in box 1.") }}} function OntesterEvent_CtrlClicked(PlusWnd, ControlId){ if(ControlId == "startTest") {checkLove();} else if(ControlId == "sendResults") {sendResult();} else if(ControlId == "BtnClose") {PlusWnd.Close(1);} } END OF CODE please reply with a fixed script with a line like %=50+50 or something so the output is 100%. thanks Hello - I'm a total newbie to html and javascript but have been forced to learn it somewhat since I'm making a website for my wife's business. Anyway, the site has a page where people can choose from menuitems of a form ("select" elements). That form info is then used to call Foxycart. I've decided to link the choosing of those menu-items to showing appropriate product images, thus providing visual feedback for the buyer. I have hacked my way to a point that the page does what I want in Firefox, but it breaks in IE and I have no idea why since the same sort of simple code algorithm to poll the menus with "document.getElementByIdworks" works in IE until I leave the page, but then stops working when I return. The page is he http://angelatoyarn.squarespace.com/...our-own-gelato (the site is still a WIP obviously) In Firefox everything is fine - I can select the items I want and the pictures of those images appear at the bottom of the page. If I leave the page and come back, the function Updateyarn() is called which grabs the .selectedindex values and re-inserts the images. But in IE when I leave the page and come back the select-menus retain their previous values (as they should) but my update yarn () function errors out and doesn't return a valid integer. Please Help! I have no Earthly clue why the IE version is breaking. -thanks, - TJ hi folks extreme newbie here when it comes to javascript. I have an assignment that in which ive created the html+css for the webpage (a pizza form validation basically). and Now I must do the javascript aspect of it. Unfortunately I have no idea how to even begin i dont understand how to use any of these .toUpperCase() .toLowerCase(), how to use window.open for errors instead of alert and all these other things. the way i'm coding it, is with an external file called script.js that will have all my coding and then i have my index.html file...i dont know how to 'call' (if thats the right term) the function to the index.html...or even make jscript code either lol. as an example of a requirement: Code: field01 - Client Surname- Maximum allowable length is 15 positions Must be present. Minimum of four (4) alphabetic characters lower case (a-z) or upper case (A-Z) or a mix of lower & upper case. Optional special characters Optional one (1) apostrophe if present - must have at least 1 alphabetic character before it and one alphabetic character after it. Optional one (1) hyphen if present - must have at least 1 alphabetic character before it and one alphabetic character after it. this is my assignment requirements for those need a better understanding of what's going on https://cs.senecac.on.ca/~int222/***...assignment3-2/ my request is if there is anyone who can lead me in the direction to a website or downloadable book on how to do what it's asking (in no way am i asking someone to do my assignment for me). My professor has his website that has all these predefined things (im assuming are functions) that should be used but i dont understand it nor do i understand him. Any help would be immensely appreciated, thank you. Can someone please convert this vbscript to jscript. Thank you. Code: strComputer = "." Set objWMIService = GetObject("winmgmts:" _ & "{impersonationLevel=impersonate}!\\" & _ strComputer & "\root\cimv2") Set colMonitoredEvents = objWMIService.ExecNotificationQuery _ ("SELECT * FROM __InstanceCreationEvent WITHIN 10 WHERE " _ & "Targetinstance ISA 'CIM_DirectoryContainsFile' and " _ & "TargetInstance.GroupComponent= " _ & "'Win32_Directory.Name=""c:\\\\scripts""'") Do Set objLatestEvent = colMonitoredEvents.NextEvent Wscript.Echo objLatestEvent.TargetInstance.PartComponent Loop I'm going crazy trying to figure this out. What I'm looking for is a javascript timer / count down script. When the hours, minutes and seconds hit 0, I need a button the page to become enabled and I also need a button to pause the timer and start it. I have the following code so far. Willing to pay $50 for solution...
Code: <html> <head> <title>Countdown</title> <script type="text/javascript"> // how many minutes var mins = 30; // how many seconds var secs = mins * 60; function countdown() { setTimeout('Decrement()',1000); } function Decrement() { if (document.getElementById) { minutes = document.getElementById("minutes"); seconds = document.getElementById("seconds"); // if less than a minute remaining if (seconds < 59) { seconds.value = secs; } else { minutes.value = getminutes(); seconds.value = getseconds(); } secs--; if(secs > 0) { setTimeout('Decrement()',1000); } } } function getminutes() { // minutes is seconds divided by 60, rounded down mins = Math.floor(secs / 60); return mins; } function getseconds() { // take mins remaining (as seconds) away from total seconds remaining return secs-Math.round(mins *60); } </script> </head> <body onload="countdown();"> Countdown: <form><input id="minutes" type="text" style="width: 22px;"> minutes <input id="seconds" type="text" style="width: 22px"> seconds remaining.</form> </body> </html> Hi peeps, I'm trying to replicate this navigation effect I found when looking through a website design gallery: http://www.nissanusa.com/leaf-electr...ing-experience To be honest, I'm not sure where to start - I've tried searching for this but can't seem to find any plugins like it. Would appreciate any help I can get on this! Thanks in advance! hi guys, I have built an rss ripper, the point is to bypass technology restrictions when exporting from sharepoint to excel 2003. My problem i'm using the code below to output data in a nice html tabular format, however when trying to import into excel via web query i get no data returned, i think this is as it isn't real html, i've made a few alterations and am now getting account pulled back - how do i get it to pull all the data ? code is as follows, also i've put a link at the bottom to w3 so you can get a good idea of the issue: <%@ Language=VBScript %> <html> <head> <script type="text/javascript" src="loadxmldoc.js"></script> </head> <body> <script type="text/javascript"> function loadXMLDoc() { if (window.XMLHttpRequest) { xhttp=new XMLHttpRequest(); } else { xhttp=new ActiveXObject("Microsoft.XMLHTTP"); } xhttp.open("GET","my file path",false); xhttp.send(); return xhttp.responseXML; } xmlDoc=loadXMLDoc(""); uppernum=(xmlDoc.getElementsByTagName( "title" ).length ); accstartnum=2 detstartnum=1 qlow = 0 qhi = 12 //document.write("<table border=1") </script><table border = 1><tr><script> z=xmlDoc.getElementsByTagName("description")[detstartnum] </script><td>Account</td><script> y=z.childNodes[0]; data_dump = (y.nodeValue); data_dump = data_dump.replace(/<div><b>/g,""); data_dump = data_dump.replace(/div>/g,""); data_dump = data_dump.replace(/b>/g,""); data_dump = data_dump.replace(/</g,""); data_dump = data_dump.replace(/\n/g,""); data_dump = data_dump.replace(/\//g,""); data_array = data_dump.split(":"); array_pos = 0 while (array_pos < data_array.length) { if (array_pos%2) { document.write ("<td>" + data_array[array_pos] + "</td>"); array_pos+=1; } else { array_pos+=1; } } document.write("</tr>") while (accstartnum < uppernum) { document.write("<tr>") x=xmlDoc.getElementsByTagName("title")[accstartnum] y=x.childNodes[0]; acc = (y.nodeValue); z=xmlDoc.getElementsByTagName("description")[detstartnum] y=z.childNodes[0]; data_dump = (y.nodeValue); data_dump = data_dump.replace(/<div><b>/g,""); data_dump = data_dump.replace(/div>/g,""); data_dump = data_dump.replace(/b>/g,""); data_dump = data_dump.replace(/</g,""); data_dump = data_dump.replace(/\n/g,""); data_dump = data_dump.replace(/\//g,""); data_array = data_dump.split(":"); array_pos = 1 document.write("<td>" + acc + "</td>") while (array_pos < data_array.length) { if (array_pos%2) { array_pos+=1; } else { document.write ("<td>" + data_array[array_pos] + "</td>") array_pos+=1; } } accstartnum+=1; detstartnum+=1; document.write("</tr>") } </script></table><script> //url = document.location.href; //urll = url.split("?"); //if (urll.length == 0) // { // document.self.location.replace("http://midevsso.gcf-uk.gcf.capital.ge.com/Development/rssreader.asp?reload=1"); // } </script> </body> </html> if you have excel 2003 you can get an idea of the issue by trying to import the table he http://www.w3schools.com/XML/tryit.a..._display_table I have been trying for several days now to append a text caption to a displayed image using Javascript, but with no real success. Perhaps JS is not the best way. Has anyone a suggestion as to the best way to tackle this. I want to replace the image captions with text ones to help speed up the site. It is my home site here. A modification of the existing code seems obvious, but I have been unable to do this. Any help gratefully received. Frank I am trying to run a stored proc from my page using JScript and I am stuck on this error: Quote: Microsoft OLE DB Provider for ODBC Drivers error '80040e14' [Microsoft][ODBC SQL Server Driver][SQL Server]Procedure or Function 'AD_AdminInsert2' expects parameter '@CourseID', which was not supplied. The param @CourseID is requested in the stored proc but I don't know why it is not finding it from the following code: Code: cmdAdminInsert = Server.CreateObject("ADODB.Command"); cmdAdminInsert.ActiveConnection = connStringforTest; cmdAdminInsert.CommandText = "dbo.AD_AdminInsert2"; cmdAdminInsert.CommandType = adCmdStoredProc; cmdAdminInsert.Parameters.Append(cmdAdminInsert.CreateParameter ("RETURN_VALUE", adInteger, adParamReturnValue)); cmdAdminInsert.Parameters.Append(cmdAdminInsert.CreateParameter ("@CallerAdminID", adInteger, adParamInput, 1709)); cmdAdminInsert.Parameters.Append(cmdAdminInsert.CreateParameter ("@CourseID", adInteger, adParamInput, 65)); cmdAdminInsert.Parameters.Append(cmdAdminInsert.CreateParameter ("@AdminID", adInteger, adParamOutput)); cmdAdminInsert.Parameters.Append(cmdAdminInsert.CreateParameter ("@OutputResult", adVarChar, adParamOutput, 255)); cmdAdminInsert.Execute(); cmdAdminInsert.ActiveConnection.Close(); An insight or links would be appreciated. Thanks, JJ I get "Microsoft JScript runtime error: '$' is undefined" with the javascript below. How should I troubleshoot this? <script type="text/javascript" language="javascript"> function ShowPopup() { $('#mask').show(); $('#<%=pnlpopup.ClientID %>').show(); } function HidePopup() { $('#mask').hide(); $('#<%=pnlpopup.ClientID %>').hide(); } $(".btnClose").live('click', function () { HidePopup(); }); </script> I have encountered unpleasant thing. Code: var htmlfile = new ActiveXObject('htmlfile'); var window = htmlfile.parentWindow; var document = window.document; var tag = document.createElement('textarea'); tag.innerHTML = 'any non-empty string'; The example above in JScript environment throws the following exception Quote: htmlfile: Catastrophic failure Any script (JS or VBS) is down when assign the 'innerHTML' property of tags. In these examples I create the TEXTAREA tag but it does not matter. This don't work for ALL block or inline tags. Nevertheless an assignment of the 'innerHTML' property in browsers works fine (see the second example). Code: var tag = document.createElement('textarea'); tag.innerHTML = 'any non-empty string'; I have a question. Is this known bug or feature of the 'htmlfile' object? Or maybe someone of you has encountered this? hi i am trying to populate a textarea with the selections like checkboxes radiobuttons textbox combobox but i cant seem to do so. i am naive to the field of programing, and found a few code snippets to do so i tried but it did no good... help needed this is my code " <html> <head> <style type="text/css"> .minitext { font: normal 0.7em Arial, sans-serif; color: Black; } .disable { background-color: #CF110C; color: #fff; font-weight: bold; padding: 5px; } </style> <script language="Javascript" type="text/javascript"> function populateTextArea(){ var output = new Array(); var fieldID = 1; while (fieldObj = document.MyForm['iid'+fieldID]) { if (fieldObj.length) { for (var j=0; j<fieldObj.length; j++) { if (fieldObj[j].checked) { output[output.length] = fieldObj[j].value;} }//end of for } //end of if else { if (fieldObj.checked) { output[output.length] = fieldObj.value; } }//end of else fieldID++; }// end of while document.getElementById('targetarea').value = output.join(', '); //document.MyForm.targetarea.value = document.MyForm.ip1.value + '\n' + document.MyForm.ip2.value + '\n' + document.MyForm.ip3.value ; } </script> </head> <body> <br> <br> <form name="MyForm" method="POST" action="#"> String 1: <input type="text" name="ip1" value=""><br> String 2: <input type="text" name="ip2" value=""><br> String 3: <input type="text" name="ip3" value=""><br><br> <input type="checkbox" name="iid1" id="pe_item2" value="Text string 1"> Text string <input type="checkbox" name="iid1" id="pe_item2" value="Text string 12"> Text string 1<br><br><br> <input type="radio" name="iid2" id="pe_item4" value="Text string 2">Text string 2 <input type="radio" name="iid2" id="pe_item6" value="Text string 3">Text string 3<br> <input type="radio" name="iid3" id="pe_item8" value="Text string 4">Text string 4 <input type="radio" name="iid3" id="pe_item10" value="Text string 5">Text string 5<br> <input type="radio" name="iid4" id="pe_item12" value="Text string 6">Text string 6 <input type="radio" name="iid4" id="pe_item14" value="Text string 7">Text string 7<br> <br> <br> <a href="#" onClick="document.MyForm.targetarea.value = document.MyForm.ip1.value + '\n' + document.MyForm.ip2.value + '\n' + document.MyForm.ip3.value + populateTextArea();" >Populate</a><br> <br> <INPUT TYPE=BUTTON VALUE="Co" ONCLICK= populateTextArea(); > <br> <textarea id="targetarea" name ="targetarea" cols="50" rows="5"></textarea> </form> </body> </html> " help need this done urgently The code is JScript .NET, which is basically a .NET version of Javascript. Regardless of language, Anyone with appending type of skill can answer my question. The problem is, when I keep issuing the request it keeps appending over and over again Code: if (oSession.uriContains("search?q=")) { var str = oSession.fullUrl; var sAppend = "+test1+test2+test3"; if (!oSession.uriContains(sAppend)) { oSession.fullUrl = str.replace( "search?q=","search?q="+sAppend); } } Can you please give me an example? I'm still new to programming. Thank you I have a simple play js button on my HTML page as well as embedded music. So when you are a computer the music autoplays then stops and you have the option to listen to it again with the js button. This "theoretically" will work fine for the iPhone and iPad because even though the embedded music isn't auto playing the user can still click the listen button and hear the music. It works on the iPhone perfectly but not the iPad. I'm at a loss. Here is my jscript: function FFFFSound(soundobj) { var thissound= eval("document."+soundobj); thissound.Play(); } My embedded music: <embed src="music/FFFFKids.mp3" autostart="true" loop="false" hidden="true"> <embed src="music/FFFFKids.mp3" autostart="false" loop="false" hidden="true" name="sound1"> And my button: <input type="button" value="Listen" onClick="FFFFSound('sound1')" class="listen_button"> You can view the page at feefifofun.com I am at a total loss..... thanks! Hello all, I have the following code to load a new html page into the 'new content' div once the user scrolls to the bottom of the page. It all works fine. No problems, except I would like it to pause for a moment whilst it is loading, and show a loading box div at the bottom of the screen as it loads the new content, just to give some positive feedback for the user. So the new div would sit in a fixed position at 'bottom:0px;' and have a loading image inside it. Is this easy to do? I am new to javascript so bear with me Code: alreadyloading = false; nextpage = 2; $(window).scroll(function() { if($(window).scrollTop() + $(window).height() == $(document).height()) { if (alreadyloading == false) { var url = "page"+nextpage+".html"; alreadyloading = true; $.post(url, function(data) { $('#newcontent').children().last().after(data); alreadyloading = false; nextpage++; }); } } }); The 'new content' is a div which is at the bottom of the page and is where the new content loads to! Thank you very much |