File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

HTTP request question

 
david arnold
Ranch Hand
Posts: 133
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 64185
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
david arnold
Ranch Hand
Posts: 133
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 64185
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 133
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 64185
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 133
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 64185
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 15385
6
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic