From: Naomi M. <na...@sm...> - 2007-01-16 10:28:44
|
Question re. js. I have opened a new window (to display report) and it has a 'close' link which worked like a sweetie in some browsers (usual story). Anyhow at the mo I have some javascript which is based around the good ol' window.close() method, this sort of works, the only prob is that it still submits, i.e. it executes the bit of html in the template that goes off to the method in Facility (which then throws a null pointer). How do I stop this from happening? Cheers, Naomi. |
From: Matthew B. <mat...@ou...> - 2007-01-16 10:33:47
Attachments:
matthew.buckett.vcf
|
Naomi Miles wrote: > Question re. js. I have opened a new window (to display report) and > it has a 'close' link which worked like a sweetie in some browsers > (usual story). Anyhow at the mo I have some javascript which is > based around the good ol' window.close() method, this sort of works, > the only prob is that it still submits, i.e. it executes the bit of > html in the template that goes off to the method in Facility (which > then throws a null pointer). How do I stop this from happening? When you say "executes the bit of HTML" what do you mean? Do you mean your popup window contains a form and when the user clicks on the close link the form gets submitted? Do you have the HTML somewhere so we could have a look at it? -- Matthew Buckett |
From: Naomi M. <na...@sm...> - 2007-01-16 10:42:40
|
Nope, it's not a form. After I hit the 'close' link, it still goes to Facility and tries to execute the getReport method defined in the <call>, and I want to stop it from doing this. <template . . . > <html> <head> - </head> <body> <div id="AdminFrame"> <div id="AdminMenuTabBox"> <div style="float:left;"> <img src="bs_template_back-arrow.gif" width="30" height="30" border="0" alt="Back Icon"/> </div> <div> <a href="javascript:window.open ('','_parent','');window.close();return false;"><localise id="link.close"/></a> </div> </div> <div id="AdminMenuContentBox"> <div class="mediumPadding"> <call> <target method="getReport"> <variable name="facility"/> </target> <parameters> <variable name="request"/> <variable name="writer"/> </parameters> </call> </div> </div> </div> </body> </html> </template> On 16 Jan 2007, at 10:33, Matthew Buckett wrote: > Naomi Miles wrote: >> Question re. js. I have opened a new window (to display report) and >> it has a 'close' link which worked like a sweetie in some browsers >> (usual story). Anyhow at the mo I have some javascript which is >> based around the good ol' window.close() method, this sort of works, >> the only prob is that it still submits, i.e. it executes the bit of >> html in the template that goes off to the method in Facility (which >> then throws a null pointer). How do I stop this from happening? > > When you say "executes the bit of HTML" what do you mean? Do you mean > your popup window contains a form and when the user clicks on the > close > link the form gets submitted? > > Do you have the HTML somewhere so we could have a look at it? > > -- > Matthew Buckett > <matthew.buckett.vcf> > ---------------------------------------------------------------------- > --- > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to > share your > opinions on IT & business topics through brief surveys - and earn cash > http://www.techsay.com/default.php? > page=join.php&p=sourceforge&CID=DEVDEV________________________________ > _______________ > Bodington-developers mailing list > Bod...@li... > https://lists.sourceforge.net/lists/listinfo/bodington-developers |
From: Matthew B. <mat...@ou...> - 2007-01-16 11:16:30
Attachments:
matthew.buckett.vcf
|
Naomi Miles wrote: > Nope, it's not a form. After I hit the 'close' link, it still goes > to Facility and tries to execute the getReport method defined in the > <call>, and I want to stop it from doing this. Firebug pointed me in the direction for this which I can't recommend enough. http://getfirebug.com/ Remove the return, the value of the last statement should be enough so it ends window.close();false;"> I'm not sure this works in javascript URLs but I think it's how onsubmit for forms normally works. -- Matthew Buckett |
From: Naomi M. <na...@sm...> - 2007-01-16 12:00:23
|
All I need it to do is close when the user hits the close link (in all browsers), at the moment it just goes off to Facility anyhow and I'm trying to stop it doing that. I'm coming to the conclusion that I'll have to do it another way. It worked fine in Safari if you just used href=".", but not in FF or IE, so I'm trying to find a solution that works for all. On 16 Jan 2007, at 11:46, Colin Tatham wrote: > I'm not really following what you need the template to do Naomi, > but is > there a way you can achieve what you want to another way, that > possibly > doesn't involve JavaScript? Maybe use some conditional logic in the > template to call different methods in the Facility class you're using? > > Colin > > Matthew Buckett wrote: >> Naomi Miles wrote: >>> Nope, it's not a form. After I hit the 'close' link, it still goes >>> to Facility and tries to execute the getReport method defined in the >>> <call>, and I want to stop it from doing this. >> >> Firebug pointed me in the direction for this which I can't >> recommend enough. >> >> http://getfirebug.com/ >> >> Remove the return, the value of the last statement should be >> enough so >> it ends >> window.close();false;"> >> >> I'm not sure this works in javascript URLs but I think it's how >> onsubmit >> for forms normally works. >> >> >> --------------------------------------------------------------------- >> ---- >> Take Surveys. Earn Cash. Influence the Future of IT >> Join SourceForge.net's Techsay panel and you'll get the chance to >> share your >> opinions on IT & business topics through brief surveys - and earn >> cash >> http://www.techsay.com/default.php? >> page=join.php&p=sourceforge&CID=DEVDEV >> >> >> --------------------------------------------------------------------- >> --- >> >> _______________________________________________ >> Bodington-developers mailing list >> Bod...@li... >> https://lists.sourceforge.net/lists/listinfo/bodington-developers > > > -- > ____________________________________ > Colin Tatham > VLE Team > Oxford University Computing Services > > http://www.oucs.ox.ac.uk/ltg/vle/ > http://bodington.org > > ---------------------------------------------------------------------- > --- > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to > share your > opinions on IT & business topics through brief surveys - and earn cash > http://www.techsay.com/default.php? > page=join.php&p=sourceforge&CID=DEVDEV > _______________________________________________ > Bodington-developers mailing list > Bod...@li... > https://lists.sourceforge.net/lists/listinfo/bodington-developers |
From: Matthew B. <mat...@ou...> - 2007-01-16 12:09:16
Attachments:
matthew.buckett.vcf
|
Naomi Miles wrote: > All I need it to do is close when the user hits the close link (in > all browsers), at the moment it just goes off to Facility anyhow and > I'm trying to stop it doing that. I'm coming to the conclusion that > I'll have to do it another way. It worked fine in Safari if you just > used href=".", but not in FF or IE, so I'm trying to find a solution > that works for all. Have you tried a href='#'? -- Matthew Buckett |
From: Adam M. <ada...@ou...> - 2007-01-16 12:23:36
|
Can't you just stick this on the pop-up page? Or have I missed the point here?: <script type="text/javascript" language="JavaScript"> <!-- document.write('<form><div align="center"><input type="button" value="Close" name="js_close_window" tabindex="1" onClick="window.close()" class="js_close_window"></div></form>'); // --> </script> <noscript>Use the browser to close this window. This will not save any data entered on the <strong>current</strong> page.</noscript> A dam | -----Original Message----- | From: bod...@li... | [mailto:bod...@li...] On Behalf Of | Naomi Miles | Sent: 16 January 2007 12:00 | To: Bodington developers | Subject: Re: [Bodington-developers] close window prob | | All I need it to do is close when the user hits the close link (in | all browsers), at the moment it just goes off to Facility anyhow and | I'm trying to stop it doing that. I'm coming to the conclusion that | I'll have to do it another way. It worked fine in Safari if you just | used href=".", but not in FF or IE, so I'm trying to find a solution | that works for all. | | On 16 Jan 2007, at 11:46, Colin Tatham wrote: | | > I'm not really following what you need the template to do Naomi, | > but is | > there a way you can achieve what you want to another way, that | > possibly | > doesn't involve JavaScript? Maybe use some conditional logic in the | > template to call different methods in the Facility class you're using? | > | > Colin | > | > Matthew Buckett wrote: | >> Naomi Miles wrote: | >>> Nope, it's not a form. After I hit the 'close' link, it still goes | >>> to Facility and tries to execute the getReport method defined in the | >>> <call>, and I want to stop it from doing this. | >> | >> Firebug pointed me in the direction for this which I can't | >> recommend enough. | >> | >> http://getfirebug.com/ | >> | >> Remove the return, the value of the last statement should be | >> enough so | >> it ends | >> window.close();false;"> | >> | >> I'm not sure this works in javascript URLs but I think it's how | >> onsubmit | >> for forms normally works. | >> | >> | >> --------------------------------------------------------------------- | >> ---- | >> Take Surveys. Earn Cash. Influence the Future of IT | >> Join SourceForge.net's Techsay panel and you'll get the chance to | >> share your | >> opinions on IT & business topics through brief surveys - and earn | >> cash | >> http://www.techsay.com/default.php? | >> page=join.php&p=sourceforge&CID=DEVDEV | >> | >> | >> --------------------------------------------------------------------- | >> --- | >> | >> _______________________________________________ | >> Bodington-developers mailing list | >> Bod...@li... | >> https://lists.sourceforge.net/lists/listinfo/bodington-developers | > | > | > -- | > ____________________________________ | > Colin Tatham | > VLE Team | > Oxford University Computing Services | > | > http://www.oucs.ox.ac.uk/ltg/vle/ | > http://bodington.org | > | > ---------------------------------------------------------------------- | > --- | > Take Surveys. Earn Cash. Influence the Future of IT | > Join SourceForge.net's Techsay panel and you'll get the chance to | > share your | > opinions on IT & business topics through brief surveys - and earn cash | > http://www.techsay.com/default.php? | > page=join.php&p=sourceforge&CID=DEVDEV | > _______________________________________________ | > Bodington-developers mailing list | > Bod...@li... | > https://lists.sourceforge.net/lists/listinfo/bodington-developers | | | ------------------------------------------------------------------------- | Take Surveys. Earn Cash. Influence the Future of IT | Join SourceForge.net's Techsay panel and you'll get the chance to share | your | opinions on IT & business topics through brief surveys - and earn cash | http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV | _______________________________________________ | Bodington-developers mailing list | Bod...@li... | https://lists.sourceforge.net/lists/listinfo/bodington-developers |
From: Colin T. <col...@ou...> - 2007-01-16 11:46:55
|
I'm not really following what you need the template to do Naomi, but is there a way you can achieve what you want to another way, that possibly doesn't involve JavaScript? Maybe use some conditional logic in the template to call different methods in the Facility class you're using? Colin Matthew Buckett wrote: > Naomi Miles wrote: >> Nope, it's not a form. After I hit the 'close' link, it still goes >> to Facility and tries to execute the getReport method defined in the >> <call>, and I want to stop it from doing this. > > Firebug pointed me in the direction for this which I can't recommend enough. > > http://getfirebug.com/ > > Remove the return, the value of the last statement should be enough so > it ends > window.close();false;"> > > I'm not sure this works in javascript URLs but I think it's how onsubmit > for forms normally works. > > > ------------------------------------------------------------------------- > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to share your > opinions on IT & business topics through brief surveys - and earn cash > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > > > ------------------------------------------------------------------------ > > _______________________________________________ > Bodington-developers mailing list > Bod...@li... > https://lists.sourceforge.net/lists/listinfo/bodington-developers -- ____________________________________ Colin Tatham VLE Team Oxford University Computing Services http://www.oucs.ox.ac.uk/ltg/vle/ http://bodington.org |