Solved

Get this to run off of the onClick=""

Posted on 2003-11-14
11
224 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
Independent Software Vendors: 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

[Webinar] Code, Load, and Grow

Managing multiple websites, servers, applications, and security on a daily basis? Join us for a webinar on May 25th to learn how to simplify administration and management of virtual hosts for IT admins, create a secure environment, and deploy code more effectively and frequently.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Problem with Pie chart in Jsp 20 248
struts hibernate integration example 28 157
main method of string class 3 123
iterator/ListIterator approach 17 68
When using a search centre, I'm going to show you how to configure Sharepoint's search to only return results from the current site collection. Very useful when using Office 365 with multiple site collections.
Check out this step-by-step guide for asking an anonymous question on Experts Exchange.
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

732 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