Solved

Get this to run off of the onClick=""

Posted on 2003-11-14
11
220 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
  • 3
  • 3
  • 3
11 Comments
 
LVL 6

Author Comment

by:dgelinas
Comment Utility
All it does it open a jsp popupwindow :)
0
 
LVL 35

Expert Comment

by:TimYates
Comment Utility
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
Comment Utility
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
 
LVL 35

Expert Comment

by:TimYates
Comment Utility
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
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
LVL 6

Author Comment

by:dgelinas
Comment Utility
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
Comment Utility
0
 
LVL 14

Expert Comment

by:kennethxu
Comment Utility
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
Comment Utility
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
Comment Utility
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

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Suggested Solutions

HOW TO: Upload an ISO image to a VMware datastore for use with VMware vSphere Hypervisor 6.5 (ESXi 6.5) using the vSphere Host Client, and checking its MD5 checksum signature is correct.  It's a good idea to compare checksums, because many installat…
Veeam Backup & Replication has added a new integration – Veeam Backup for Microsoft Office 365.  In this blog, we will discuss how you can benefit from Office 365 email backup with the Veeam’s new product and try to shed some light on the needs and …
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

743 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now