| Author |
HTTP request question
|
david arnold
Ranch Hand
Joined: Apr 10, 2009
Posts: 129
|
|
hi,
I have the javascript code like this:
I do not know why it does not work in case 1, I tried to make different ajax calls using this same doSentRequest method, which I need transfer the call back function name.
Thanks.
|
 |
Bear Bibeault
Author and ninkuma
Marshal
Joined: Jan 10, 2002
Posts: 56155
|
|
|
If you do not have a function named callBackFunctionName why would you expect it to work? There's certainly got to be much more to this question than you've posted.
|
[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
|
 |
david arnold
Ranch Hand
Joined: Apr 10, 2009
Posts: 129
|
|
|
Thank you Bear, i thought " handleResponse " was transferred as "scan.do" does. My mind does not work well sometimes these days (worked 14 hours yesterday), i have to finish a project with a very tight schedule, and i have many things to learn.
|
 |
Bear Bibeault
Author and ninkuma
Marshal
Joined: Jan 10, 2002
Posts: 56155
|
|
No. There's no magic just because this is Ajax. All the normal rules of JavaScript still apply.
If you want what you have there to work, you need to pass a reference to the callback function to your doSendRequest function, not a string. A string is a string and can't magically become a function. (The string could be used to look up the function definition, but that's another show.)
But the more basic question I'd ask is: why are you doing your own Ajax rather than letting jQuery or Dojo handle it?
|
 |
david arnold
Ranch Hand
Joined: Apr 10, 2009
Posts: 129
|
|
Thank you Bear for the info.
One reason I did not choose jquery/dojo is license conern. The other reason is that I took a look at jquery/dojo, and feels that the tight time i have do not allow me to learn/use it, maybe i am wrong. Anyway, thanks for help!
|
 |
Bear Bibeault
Author and ninkuma
Marshal
Joined: Jan 10, 2002
Posts: 56155
|
|
david arnold wrote:One reason I did not choose jquery/dojo is license conern.
What license concern? There is no license concern.
i have do not allow me to learn/use it
Do you have time to deal with all the nuances and cross-browser issues that Ajax has on your own?
|
 |
david arnold
Ranch Hand
Joined: Apr 10, 2009
Posts: 129
|
|
from my understanding, if I use GPL license in a project A, person A buy this project from me and he can use it, but he can not sell it to others, right?
I do not know much about Ajax cross browser issue, and i have not got chance to test cross browser so far, i only have simple http request browser check. Any big issue i need to know?
Thanks.
|
 |
Bear Bibeault
Author and ninkuma
Marshal
Joined: Jan 10, 2002
Posts: 56155
|
|
david arnold wrote:from my understanding, if I use GPL license in a project A, person A buy this project from me and he can use it, but he can not sell it to others, right?
And which product are you concerned about being released under a GPL license?
|
 |
Eric Pascarello
author
Rancher
Joined: Nov 08, 2001
Posts: 15357
|
|
You are thinking that you can assign multiple function calls.
That code above is the same thing as
Would you expect to see both 1 and 2?
Eric
|
 |
 |
|
|
subject: HTTP request question
|
|
|