Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

how to trigger js function in windows pop up jsp  RSS feed

 
Cristian Adinanda
Greenhorn
Posts: 14
Eclipse IDE Firefox Browser Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I've encountered problems when want to add js function in the windows pop up jsp.
Bellow is the whole JSP code :


This scriptlet will trigger window pop up to open / save document.

I've add additional <HTML>, <HEAD> and <BODY> to put onload function. But eventhough i just call alert('HI') in the onload, it seems the js function not triggered at all.

Can anyone help me to solve this problem?
 
E Armitage
Rancher
Posts: 989
9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why not just run a proper file servlet?
 
Cristian Adinanda
Greenhorn
Posts: 14
Eclipse IDE Firefox Browser Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

THis is an existing project, i want to add refresh only when the button triggered.
 
E Armitage
Rancher
Posts: 989
9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The code that you posted does not contain any javascript function. Use a tool like firebug to check if you javascript is being imported correctly or if it contains syntax errors.
 
Cristian Adinanda
Greenhorn
Posts: 14
Eclipse IDE Firefox Browser Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Ive add already html tag and body and also the javascript declaration. I ve tried so many times to put the js function on it, but dont know why the function even if i put in body onload, it doesnt triggered.
ive try using the js without the scriptlet then its working.
 
Paul Clapham
Sheriff
Posts: 22185
38
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm confused. The code you posted does a file download. There's no HTML there and no Javascript to be executed. So I have no idea what you are asking about.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!