|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Stay one step ahead of the competition. Evaluate and give feedback
on some of the hottest web development tools on the market today.
Make your opinion heard! Click
Here
|
|
#1
|
||||||||
|
||||||||
|
maintaining state in JavaScript
Hello all.
I have a very simple little show/hide script. The script is: php Code:
(you have all seen that one before) and this is an example of what it is hiding: php Code:
The reaons for the iframe is that it contains a form and I cannot repost the whole page - there is a lot going on. I want to maintain state but while I write cookies in PHP with my eyes closed I can't quite get JavaScript to do what I want to even though it should be easy. What changes do I need to make to the above so that the block/none value of each included element's style.display value (there are more than one) is maintained after reloading the container page? |
|
#2
|
|||
|
|||
|
RE: maintaining state in JavaScript
Well I suppose you could just send it in $_SESSION or another global, then write the html with PHP not separately:
echo "<div style="display:".$_SESSION['display'].";" id="scratchPad">"; |
|
#3
|
|||
|
|||
|
RE: maintaining state in JavaScript
No, because every time I invoke the function I have to write the value from the JavaScript. I tried reading it with PHP when the page loads but it just did not work and I could not fathom out why. I was wondering if someone could help me cheat and give me an all JavaScript option...
|
|
#4
|
|||
|
|||
|
RE: maintaining state in JavaScript
Well you could use cookies through Javascript.
|
![]() |
| Viewing: Codewalkers Forums > Other Technologies > Client Side Things > maintaining state in JavaScript |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|
|
|