I don't update DB with javascript
-
I have some code: -------Javascript ------------ ... function SavePosition(source) { // Call AJAX request to save //var url = "Home.aspx?order=" + getPositionOrder(); url = "Home.aspx?order=0 s1 s2 s3 s4 s5 s6 s7 s8 s9 s10 s11 s12" var objXmlHttp = createXMLHTTP(); objXmlHttp.open("GET", url, true); if(objXmlHttp == null) { alert("Browser does not support HTTP request!"); return; } ShowWarning(source, waitingHTML); objXmlHttp.onreadystatechange = function() { if (objXmlHttp.readyState == 4) { if(objXmlHttp.status == 200) { setTimeout("complete()", 2000); } else { alert("Error while trying to save."); } } } objXmlHttp.send(null); } When I execute the function and debug it, I see that. sometime, it executes very well, my DB is updated that mean home.aspx loaded. sometime it do nothing (because home.aspx does not load) although run step over objXmlHttp.open("GET", url, true); :doh:
The invalid URL that you are using might be part of the problem. An URL may not contain spaces, you have to encode the URL correctly. Try:
url = "Home.aspx?order=0%20s1%20s2%20s3%20s4%20s5%20s6%20s7%20s8%20s9%20s10%20s11%20s12"
--- single minded; short sighted; long gone;
-
The invalid URL that you are using might be part of the problem. An URL may not contain spaces, you have to encode the URL correctly. Try:
url = "Home.aspx?order=0%20s1%20s2%20s3%20s4%20s5%20s6%20s7%20s8%20s9%20s10%20s11%20s12"
--- single minded; short sighted; long gone;
-
I tried it, but ... it don't run. My problem: I have two textarea (object1 and object2). if { I have swap object1 and object1 (dag object1 to object 2) click save --> database was updated. } but after, I want to go back { I drag object come back. click save --> database was not saved. } --> The BIG PROBLEM! HELP ME!!!!!:^)
-
I have some code: -------Javascript ------------ ... function SavePosition(source) { // Call AJAX request to save //var url = "Home.aspx?order=" + getPositionOrder(); url = "Home.aspx?order=0 s1 s2 s3 s4 s5 s6 s7 s8 s9 s10 s11 s12" var objXmlHttp = createXMLHTTP(); objXmlHttp.open("GET", url, true); if(objXmlHttp == null) { alert("Browser does not support HTTP request!"); return; } ShowWarning(source, waitingHTML); objXmlHttp.onreadystatechange = function() { if (objXmlHttp.readyState == 4) { if(objXmlHttp.status == 200) { setTimeout("complete()", 2000); } else { alert("Error while trying to save."); } } } objXmlHttp.send(null); } When I execute the function and debug it, I see that. sometime, it executes very well, my DB is updated that mean home.aspx loaded. sometime it do nothing (because home.aspx does not load) although run step over objXmlHttp.open("GET", url, true); :doh:
I tried it, but ... it don't run. My problem: I have two textarea (object1 and object2). if { I have swap object1 and object1 (dag object1 to object 2) click save --> database was updated. } but after, I want to go back { I drag object come back. click save --> database was not saved. } --> The BIG PROBLEM! HELP ME!!!!!
-
I tried it, but ... it don't run. My problem: I have two textarea (object1 and object2). if { I have swap object1 and object1 (dag object1 to object 2) click save --> database was updated. } but after, I want to go back { I drag object come back. click save --> database was not saved. } --> The BIG PROBLEM! HELP ME!!!!!:^)
-
I handly understand anything of what you are writing. Could you try to explain it in complete sentences?
--- single minded; short sighted; long gone;
Thanks you so much. I have a problem below. I use javascript in my project to drag and drop some objects that exchange position. when I log in and do the function (drag and drop) after save the position to my DB ==> OK. But i drag and drop back and save ==> it is not save to DB ==> BROBLEM???? i used dojo library.
-
I tried it, but ... it don't run. My problem: I have two textarea (object1 and object2). if { I have swap object1 and object1 (dag object1 to object 2) click save --> database was updated. } but after, I want to go back { I drag object come back. click save --> database was not saved. } --> The BIG PROBLEM! HELP ME!!!!!
you can try with !ispostback; If can't please reply;:):):):)
-
I tried it, but ... it don't run. My problem: I have two textarea (object1 and object2). if { I have swap object1 and object1 (dag object1 to object 2) click save --> database was updated. } but after, I want to go back { I drag object come back. click save --> database was not saved. } --> The BIG PROBLEM! HELP ME!!!!!:^)
Spaces in URL ought to be URLEncoded before being transmitted.
tranglt wrote:
--> The BIG PROBLEM! HELP ME!!!!!
Please avoid such quotes in discussion forums.
Vasudevan Deepak Kumar Personal Homepage Tech Gossips
-
you can try with !ispostback; If can't please reply;:):):):)
:)
Vasudevan Deepak Kumar Personal Homepage Tech Gossips
-
:)
Vasudevan Deepak Kumar Personal Homepage Tech Gossips
English pleaase. Im vietnamese but i use english, why u can't?