• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 231
  • Last Modified:

Get this to run off of the onClick=""

<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
dgelinas
Asked:
dgelinas
  • 3
  • 3
  • 3
2 Solutions
 
dgelinasAuthor Commented:
All it does it open a jsp popupwindow :)
0
 
TimYatesCommented:
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
 
TimYatesCommented:
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
Industry Leaders: 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!

 
TimYatesCommented:
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
 
dgelinasAuthor Commented:
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
 
kennethxuCommented:
0
 
kennethxuCommented:
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
 
dgelinasAuthor Commented:
I'm doing a jsp popup from an include. I wouldn't need a popup code generator to do a simple html popup
0
 
kennethxuCommented:
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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

  • 3
  • 3
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now