| |
| |
| |
|
Page: 1 2
Comments:
<0> Is there anybody alive ? <0> for ....1 minute :) <1> i was alive <2> was? <2> :P <3> hello <4> Hi, I need to execute a function after my page has finished loading, will the onload function do this after the page has loaded, or when the page _starts_ to load? <5> After it has loaded. <4> Thanks. <6> how do I retrieve the protocol? <6> like http or https? <5> window.location.protocol <4> I'm making an AJAX web site, using php on the server. When I "add a site" on my server, it runs addsite.php and when that's finished I need to update the div box that that script's output is in. I tried using a "body onload" to run the function which updates it, but it doesn't work. I have a button which does work, but I would like it to automatically refresh, is there another function, aside from onload that I can look at? <5> Heh. <5> You don't normally run ajax onload. <5> And it comes with its own event handler to see when the serverside script has finished running.
<4> Oh <4> That's something for me to look at then, thanks. <5> Which any ajax tutorial worth its salt would have told you. <4> I have Ajax For Dummies, but I'm just skimming through it. <5> Heh. <5> "For dummies" books is a waste of time and money. <4> ebook ;) <5> Do you want to learn how to be an idiot who knows a bit about ajax? :-) <4> True. <5> Ideally, you should have at least some basic knowledge of the HTTP protocol before even starting on ajax. Not to mention decent javascript knowledge. <4> I've programmed in PHP for 5 years, I find when you know one language it's enough to do the basics with any other. <5> Only the _very_ basics in this case. <5> Javascript is vastly different from PHP. <5> (Speaking as one who has done PHP for 7 and JS for 10 years) <5> And I'm still learning. <4> I did Java last year for a couple months, just enough that I know where to find how to do something. <5> Javascript is vastly different from Java as well. <5> Similar syntax (at first glance) and shared name is all they have in common. <4> Yup, livescript. <4> grr, sometimes I really hate computers. <4> I almost had this working, make a slight change, broke it, change it back and it's not working anymore. <5> Url? <4> It's nsfw. <4> I'll msg you the details. <5> I guess it'll have to wait till I get home then. <4> k <5> Unless you want to pastebin the script. <4> my ok, that'll work. <4> It's only something simple I'm trying to do. <4> http://www.pastebin.ca/327869 <4> What I'm trying to do in particular is on this line: if(dataSource == "sitelist") <5> Bad advice #1: using GET. <4> I've encoded my p***word, so it should be ok. <5> That's not it. <5> There's caching issues. <4> oh yeah, that's something I was planning on solving at some stage, adding a random number on the end of the urls. <5> Use POST. <4> I tried and failed at that. <4> Once I get the script all working, that's when I'll look at improvements. <4> Do you see anything wrong with the if statement I'm using? <4> oh ffs. <4> I just saw what's wrong. <4> datasource is the wrong variable, it's divid I should be checking. <5> Hehe. <4> My script kept reloading that div box over and over, so I thought it was working, but that must be been an error from something else. <5> I really urge you to get POST working though. <5> It's not that hard. <4> I promise I'll do that. :) <4> I know the benefits of it, I've always used GET because I'm lazy, but I'm trying to improve my programming standards. <4> I'm even using indentation nowadays. <5> .send("username="+username+"&p***word="+p***word); should do the trick. And make the neccesary changes in .open() and in sitelist.php of course. <4> Thanks. <5> And btw, deleting the object before setting it to null is rather pointless. And the garbage collector should handle it anyway. <4> I got that straight out of Ajax For Dummies. <4> I'll remove that line though. <5> "for dummies" indeed heh. <7> hi <8> my ajax function is working file with a local path (non http), but it fails when i run a .htm file (not http) to retrieve a http request <9> ? <7> Shamyl: then go to sleep
<7> your question doesnt have a glue <7> Aquel: youre here ? <7> i got some strange issue (for me ) <7> message: Statement on line 1: The Object does not implement [[Call]] <7> i got <input type="button" onmouseup="vote();"> and an alert in function vote(); <9> any reason your not using onclick? <3> yep <7> onclick neither was working, therefore i changed it on onmouseup as i was despoerated <3> what's up mate? <7> just some **** is not working :] <3> :) <3> it happens sometimes :) <7> anyway onclick or onmouseup, nothing works. <3> the name of your function may be? <7> vote ? o.O <7> holy **** <3> i don't know give it a try <7> yeah aqq <7> Aquel: <7> you got a lil kiss in the cocoahole <3> :) worked? <7> yeah <3> good mate <7> thanks a lot <3> you're welcome <3> sometimes, when errors are too weird, you know there is a trick :) <7> yeah but strange thing it was working for f.e. 15 clicks, and this distracked me <10> Hey im getting a error just wondering if anyone can help me, its just a innerHTML works fine in firefox but in ie6 and ie7 it gives a unknown runtime error and microsoft script debugger just breaks on the intterHTML line. <10> inner* <5> Url? <10> ya need to login but i can pastebin the code if ya want <5> Sure. <10> ok wait a bit <10> pastebin is a little slow... <10> http://pastebin.com/867000 <10> brb coffee <5> Another one using GET heh,. <10> yeha..not the best at javascript <5> Use POST for your ajax. <10> ok <10> amny examples or should i just google it? <5> Also change if(http.readyState == 4) to if(http.readyState == 4 && http.status == 200) <10> ok <5> And inside it, comment out what you have now and put in alert(document.getElementById('goal_name')) <10> ok <5> And then tell me what you get when you run it <10> thanx <10> [object] <5> alert(http.responseText); ? <10> i get the code i want to go in the div <10> thats why im so confused i use the same layout like 10 times and it works fine <10> but there 3 won't work in ie but another one on the same page works fine <5> Hm. <5> alert(document.getElementById('goal_name').nodeName); ? <10> DIV <5> Sounds like everything should be working... <10> yeha <10> .. <10> ive been going over it for 3days <10> and i can't see why its not working <10> could it be anything to do with the type of code thats being returned? <10> erll the http.responseText <10> well* <10> in firefox it works perfectly just not IE <5> Hm. Yes. <5> What do you return? <10> a form <10> e.g <10> <form id='changeGoalName' name='changeLossName' method='post' <10> hmmm.. <10> maybe the ' s <5> Probably better to construct it. <10> how do i do that?
Return to
#javascript or Go to some related
logs:
#linux #linux #apache #windows eileen montesin pilonadil cyst
#chatzone #linux #linuxhelp #java
|
|