Solved

Get this to run off of the onClick=""

Posted on 2003-11-14
11
225 Views
Last Modified: 2010-04-01
<jsp:include page="/pages/VertLink.jsp?link=benefits&pop_title=What+Benefits+Were+Authorized/Taken?&pop_img=sol_over/img_pop_screen_benefits.gif&pop_body=sol_over/BusinessRules_Benefits" flush="true"/>

I'm having trouble getting to work with onClick.. I know how to do it with href.. but I need onClick.  Thanks
0
Comment
Question by:dgelinas
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
  • 3
11 Comments
 
LVL 6

Author Comment

by:dgelinas
ID: 9749360
All it does it open a jsp popupwindow :)
0
 
LVL 35

Expert Comment

by:TimYates
ID: 9749406
onclick="window.location.href='/pages/VertLink.jsp?link=benefits&pop_title=What+Benefits+Were+Authorized/Taken?&pop_img=sol_over/img_pop_screen_benefits.gif&pop_body=sol_over/BusinessRules_Benefits'

I guess?
0
 
LVL 35

Accepted Solution

by:
TimYates earned 200 total points
ID: 9749419
sorry...

onclick="window.location.href='/pages/VertLink.jsp?link=benefits&pop_title=What+Benefits+Were+Authorized/Taken?&pop_img=sol_over/img_pop_screen_benefits.gif&pop_body=sol_over/BusinessRules_Benefits'"

Although what you have shown is a jsp:include which is done serverside, and an onclick is a clientside method using javascript...

javascript cannot directly interact with jsp tags....there is the network between them...

Tim
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 35

Expert Comment

by:TimYates
ID: 9749435
if you want a popup to that location, try:

<SCRIPT language="JavaScript">
<!-- Begin
  var myWindow ;
  var myLocation ;

  function popupFunc()
  {
      myLocation = '/pages/VertLink.jsp?link=benefits&pop_title=What+Benefits+Were+Authorized/Taken?&pop_img=sol_over/img_pop_screen_benefits.gif&pop_body=sol_over/BusinessRules_Benefits' ;
      var winWidth = 650 ;
      var winHeight = 580 ;

      var posLeft = ( screen.width - winWidth ) / 2 ;
      var posTop = ( screen.height - winHeight ) / 2 ;

      window.open( myLocation, 'mywindow',
                          'width=' + winWidth + ',height=' + winHeight +
                          ',top=' + posTop + ',left=' + posLeft +
                          ',resizable=yes,scrollbars=yes,toolbar=no,titlebar=no,' +
                          'location=no,directories=no,status=no,menubar=no,copyhistory=no' ) ;
    }
  }

// end -->
</SCRIPT>

<a href="#" onclick="popupfunc()">Woo!</a>
0
 
LVL 6

Author Comment

by:dgelinas
ID: 9749559
I'm trying this and I'm getting objected expected?

  function popupFunc()
  {
      myLocation = '/pages/VertLink.jsp?pop_img=sol_over/img_pop_screen_benefits.gif&pop_body=sol_over/BusinessRules_Benefits' ;
      var winWidth = 650 ;
      var winHeight = 580 ;

      var posLeft = ( screen.width - winWidth ) / 2 ;
      var posTop = ( screen.height - winHeight ) / 2 ;

      window.open( myLocation, 'mywindow',
                          'width=' + winWidth + ',height=' + winHeight +
                          ',top=' + posTop + ',left=' + posLeft +
                          ',resizable=yes,scrollbars=yes,toolbar=no,titlebar=no,' +
                          'location=no,directories=no,status=no,menubar=no,copyhistory=no' ) ;
    }
  }
0
 
LVL 14

Assisted Solution

by:kennethxu
kennethxu earned 200 total points
ID: 9750320
0
 
LVL 14

Expert Comment

by:kennethxu
ID: 9750344
and this is the code it generates:

<!-- TWO STEPS TO INSTALL POPUP WINDOW:

   1.  Paste the first into the HEAD of your HTML document
   2.  Use the code to open the popup page on your site  -->

<!-- STEP ONE: Copy this code into the HEAD of your HTML document  -->

<HEAD>

<SCRIPT LANGUAGE="JavaScript">
<!-- Idea by:  Nic Wolfe (Nic@TimelapseProductions.com) -->
<!-- Web URL:  http://fineline.xs.mw -->

<!-- This script and many more are available free online at -->
<!-- The JavaScript Source!! http://javascript.internet.com -->

<!-- Begin
function popUp(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=650,height=580,left = 187,top = 94');");
}
// End -->
</script>


<!-- STEP TWO: Use the following link to open the new window -->

<A HREF="javascript:popUp('="/pages/VertLink.jsp?link=benefits&pop_title=What+Benefits+Were+Authorized/Taken?&pop_img=sol_over/img_pop_screen_benefits.gif&pop_body=sol_over/BusinessRules_Benefits')">Open the Popup Window</A>

<!-- Script Size:  0.73 KB  -->
0
 
LVL 6

Author Comment

by:dgelinas
ID: 9751330
I'm doing a jsp popup from an include. I wouldn't need a popup code generator to do a simple html popup
0
 
LVL 14

Expert Comment

by:kennethxu
ID: 9752949
jsp is server side language is executed at the server. it CANNOT popup client side windows. javascript is client side language that is and should be used for browser popup window.

it's just a popup windows, why does it have to do with jsp include. we might be able to better help you if you can give us more detail of your problem.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article shows how to use a free utility called 'Parkdale' to easily test the performance and benchmark any Hard Drive(s) installed in your computer. We also look at RAM Disks and their speed comparisons.
In this blog we highlight approaches to managed security as a service.  We also look into ConnectWise’s value in aiding MSPs’ security management and indicate why critical alerting is a necessary integration.
This is a high-level webinar that covers the history of enterprise open source database use. It addresses both the advantages companies see in using open source database technologies, as well as the fears and reservations they might have. In this…
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…

696 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question