Ajax script in a div not reading variables from parent
here is what I have (please excuse the crappy art):
------------------------------------------
|Menu | |----------------------------|
| | |Big Div |
| | | |
| 开发者_开发百科| | ------------------------ |
| | | |Smaller Reloading Div | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | ------------------------ |
| | | |
| | |----------------------------|
------------------------------------------
This ties to another post I had earlier, basically when the user clicks a link, a script is loaded into the big div, the big div (which contains the smaller div, later on, I need to reload the smaller div but it requires variable available only in the big div, and I cannot include them in the small one for other reasons, basically the script works when you load everything at once but when you try to dynamically load the small div i get a "Invalid argument supplied" error, here is how my code structure:
Big Div Start:
...Query...
...sort results into array...
small div starts:
...Display results from array (works fine first time)...
small div ends
big div ends
Now I do not want the first query to be repeated every time the small div reloads, so how to go about that? should i be passing the array in a $_post variable once the smaller div is called? or is there a better option?
Thanks
If you want to execute some code after big div loaded, put this code into your json response and execute it using eval.
It you do not want to execute code just don't put it into small div.
精彩评论