[TriLUG] Javascript ( and jQuery ) questions
Brian McCullough via TriLUG
trilug at trilug.org
Sat Apr 18 22:41:47 EDT 2015
Folks,
I am getting VERY frustrated with a part of a project that I am working
on, so have come back to the Oracle for assistance. As usual, I should
probably have done this some time ago, but, better late than never, as I
have heard.
I have a JS function that collects various pieces of information and
then calls a server routine ( PHP ) which is supposed to act on that
information and send back a response. ( AJAX, as it happens )
However, even though I can trace some of this data through the JS code (
although that is another issue that I will mention ), I can't seem to
get it into a format that the system will pass to the server.
For instance, I have something that looks like:
var foo = jQuery( '.thisclass' );
alert( 'foo = ' + foo );
var foo_ser = foo.serialize();
alert( 'foo_ser = ' + foo_ser );
more code to prepare the call to the server.
The first alert() tells me that foo is an object. The second alert
shows me an empty string.
I have also tried .val(), which also fails.
JSON.stringify() complains that there are circular references, or words
to that effect, although I don't quite know where that would have come
from.
Incidentally, foo is a jQuery accordion.
Any suggestions to get me out of the hole that I seem to have dug
myself?
Thank you,
Brian
More information about the TriLUG
mailing list