Re: Help ! Javascript is creating unwanted sessions
Re: Help ! Javascript is creating unwanted sessions
- Subject: Re: Help ! Javascript is creating unwanted sessions
- From: "Werner Liedl" <email@hidden>
- Date: Fri, 10 Jun 2005 18:13:05 +0200
Hi Owen,
you load some images (url(openArrow.gif),url(closedArrow.gif)) with a
relative path.
I expect this causes such unwanted calls. Try an absolut path
/path/to/xxxArrow.gif instead.
HIH Werner
----- Original Message -----
From: "Owen McKerrow" <email@hidden>
To: "WO List" <email@hidden>
Sent: Thursday, June 09, 2005 3:15 PM
Subject: Help ! Javascript is creating unwanted sessions
> (Sorry for the double post if this comes through on the Omni list )
>
> Hi All,
>
> I have a page which uses CSS and Javascript to show/hide areas. The
> first time the script runs I have it searching the documents
> style-sheets for the specific style I need and check its current value.
> Once its done it once, Javascript has it it "memory" and so I don't
> need to do it again.
> However when I clicked the link that called this script I noticed a new
> session is created. In fact its being created by
> handleSessionRestorationErrorInContext(WOContext aContext ). It only
> happens the first time I click the link.
>
> I narrowed it down to the stuff that parses my style sheets. I figured
> cause I was using the style sheets as resources in my project it may
> have been asking for them again (??). So I removed them from the
> project and got it to grab them from localhost instead.
> No luck the mysterious session is still being made.
>
> Anyone have any ideas what is going on here ? Why would javascript even
> be going back to WO ? And what for ?
>
> The only style sheets I ask for are :
> <link rel="stylesheet" href="http://localhost/ccc/cccstyle.css"
> type="text/css">
> <link rel="stylesheet"
> href="http://www.library.uow.edu.au/server/default.css"
> type="text/css">
> <link rel="stylesheet"
> href="http://www.library.uow.edu.au/server/colour.css" type="text/css">
>
> Here is the hyper link :
>
> <A HREF="javascript:showHideChildren(1);">Link</A>
>
> And here is the Javascript :
> function showHideChildren(theItem)
> {
> var obj;
> var obj2;
> obj=MM_findObj('feedback' + theItem);
> obj2=MM_findObj('wrapper' + theItem);
> if(obj.style.display != "" ) {
> if(obj.style.display == "none" ) {
> obj2.style.background='url(openArrow.gif) no-repeat top left
> #FFFFFF';
> obj.style.display = "block";
> } else {
> obj2.style.background='url(closedArrow.gif) no-repeat top left
> #FFFFFF';
> obj.style.display = "none";
> }
> } else {
> changecss(('.' + obj.className),'display','none',obj,obj2);
> }
> }
>
> /* Return a style sheet object based upon the name passed in
> Credit goes to to Shawn Olson & http://www.shawnolson.net for the base
> function
> (function changecss(theClass,element,value)
> //changecss('.exampleA','color','red'))
> I hacked this from */
> function changecss(theClass,element,value,objTochange,changeImage) {
> //documentation for this script at http://www.shawnolson.net/a/503/
> var cssRules;
> var found = false;
> if (document.all) {
> cssRules = 'rules';
> } else if (document.getElementById) {
> cssRules = 'cssRules';
> }
> for (var S = 0; S < document.styleSheets.length; S++){
> for (var R = 0; R < document.styleSheets[S][cssRules].length; R++) {
> //alert(document.styleSheets[S][cssRules][R].selectorText);
> if (document.styleSheets[S][cssRules][R].selectorText == theClass) {
> //document.styleSheets[S][cssRules][R].style[element] = value;
> if (document.styleSheets[S][cssRules][R].style[element] == "block") {
> changeImage.style.background='url(closedArrow.gif) no-repeat top
> left #FFFFFF';
> objTochange.style.display = "none";
> } else {
> changeImage.style.background='url(openArrow.gif) no-repeat top left
> #FFFFFF';
> objTochange.style.display = "block";
> }
> found = true;
> break;
> }
> }
> if (found ) {
> break;
> }
> }
> }
>
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Webobjects-dev mailing list (email@hidden)
> Help/Unsubscribe/Update your Subscription:
>
>
> This email sent to email@hidden
>
--
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.323 / Virus Database: 267.6.6 - Release Date: 08.06.05
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden