I am having difficulty getting the .load() method to work with a POST variable parameter.
I searched the founders' site, jQuery.com, but there is an issue on their web-page dealing with the .load()
method for ajax calls. The issue prevents the page from fully loading. In other words, I cannot get
access to the information I need.
In my previous post to this javaRanch site,
"jQuery In Action Chapter 8 - use a php data file for ajax call" on April 14,
I detailed the GET method which works just fine, and the POST which does not.
I suspect the GET method is less secure, and besides, the spec for the project I'm doing
defines that POST vars are to be used.
Security has nothing to do with it. Some folks think that POSTing is more secure because you don't see the query parameters in the URL. This is silly because there is always a way to see query params if you want to. The difference in POST and GET, at its core, is that POST should be used for pushing data to the server in order to save/update information. With GET you are simply requesting data from the server. That's the simple explanation.
With regards to your problem, you haven't told us any details about what is happening versus what you are expecting to happen. When you say "In other words, I cannot get access to the information I need." what do you mean? Are you getting errors? Have you used a tool like Firebug to determine if the POST is going in correctly and if you are getting a response? What is happening on the server?
Dennis Spring
Greenhorn
Joined: Apr 07, 2010
Posts: 12
posted
0
Solution:
jQuery.load() expects the second parameter to be a hash.
(kudos to Brandon Orther)
Ouch. I have rarely been accused of not being forthright...
I did not post the question to another site.
One of the 'young guns' at our company helped me with it on his break.
I have shared that info with the folks visiting your site.
I did originally post the question to the 'Web' forum on your site.
However, someone moved it from that forum to something called the backporch forum, or something...
I re-posted it on this HTML forum, after I found it, hoping to get a response.
Apparently it was moved a second time to this forum, after I posted it here.
Seems like a lot of anger for a friendly place...
I did, after all, provide code for a php alternative('getDetails.php') for chapter 8 of Mr. Bibeault's book 'jquery in Action'.
Dennis Spring wrote:Ouch. I have rarely been accused of not being forthright...
No need to feel slighted. All you posted is that you got help from someone who is not a member of this site. That's usually a sign of cross-posting. No harm done.
I have shared that info with the folks visiting your site.
And we thank you for that. We like it when people do that.
I did originally post the question to the 'Web' forum on your site.
There is no "Web" forum, so I'm not sure where you mean. The Bunkhouse Porch discusses books, so since your question mentioned my book...
Future jQuery question should be posted here and there should be no confusion.
Seems like a lot of anger for a friendly place...
You are seeing anger where none is intended. Gregg was merely pointing out that if you do post elsewhere on the net that it's friendly to let people know about that so that they don't waste time posting what may have already been posted elsewhere.
You are seeing anger where none is intended. Gregg was merely pointing out that if you do post elsewhere on the net that it's friendly to let people know about that so that they don't waste time posting what may have already been posted elsewhere.
I'm not sure why you think that anyone is angry.
Maybe because I said "So how exactly did you expect us to solve your problem?". Re-reading I can see how that might have come across. But Bear is correct, no anger intended.
Written communication can be that way. My posts are frequently terse (because that's all I usually have time for) and can sometimes be taken the wrong way. I try to encourage people to imagine the poster smiling as they type and see if that changes the perception...