473,397 Members | 2,116 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,397 software developers and data experts.

linking external javascript

1
I want to be able to bring up a pop up window in another browser using an image link. I did this when I put the script in the body. I have my external javascript file and have the call code...<script language="JavaScript" type="text/javascript" src=/scripts/openpopup.js></script>. What I can't seem to figure out is how to link it to the image on my page to bring up the new pop up. The code I used for the script in my page was this one...<a href='javascript:openPopWin("http://www.basupport.com",800,600,"resizable")'> <img src="cart32.gif border=0></a>. By just using the call I have no image and no way to "tell" it what url pop up to go to..can anyone help!!!
Thanks Stef
Oct 25 '06 #1
3 5724
hi,

i'm not sure if i understood your problem correctly. But here is, what i think, you need.

I have a folder called Trial.
In it, i have an htm file - Trial.htm, and two other folders - one called Images, and the other called Scripts.

In the Images Folder, i have an image - Image1, which should come in the popup browser window.

In the Scripts Folder i have a javascript file, which contains the code for opening up the popup.

Now here is the code in the Trial. htm file

Expand|Select|Wrap|Line Numbers
  1. <html>
  2.     <head>
  3.         <script language="Javascript" type="text/Javascript" src="Scripts/Script.js"></script>
  4.     </head>
  5.     <body>
  6.         <a href="javascript:;" onClick="MM_openBrWindow('Images/Image1.gif','title','width=505,height=330')">Photo</a>
  7.     </body>
  8. </html>
In the Script.js inside the Script folder, i have the following code.

Expand|Select|Wrap|Line Numbers
  1. function MM_openBrWindow(theURL,winName,features){
  2.     window.open(theURL,winName,features);
  3. }
When i open Trial.htm using a browswer, and when i click on photo,
The popup window opens with the specified window size, and with the photo within the popup.

i hope this is what you wanted.
Oct 27 '06 #2
And again, you have called your javascript function in the anchor tags href attribute, whereas you should call the javascript function in the onClick event of the anchor tag.
Oct 27 '06 #3
Here is how i've done it:

[HTML]<div id="whatever" onclick="window.open('Your-URL-Here.html','_blank','width=999,height=555')">
<img src="Your-Image-File-Path.jpg" width=100, height=50, border="0" >
</div>[/HTML]

basically you put a div tag around the image that you want to be the link and use the onclick to call the window.open function. you can either put a URL in the first feild of window.open or an image

I want to be able to bring up a pop up window in another browser using an image link. I did this when I put the script in the body. I have my external javascript file and have the call code...<script language="JavaScript" type="text/javascript" src=/scripts/openpopup.js></script>. What I can't seem to figure out is how to link it to the image on my page to bring up the new pop up. The code I used for the script in my page was this one...<a href='javascript:openPopWin("http://www.basupport.com",800,600,"resizable")'> <img src="cart32.gif border=0></a>. By just using the call I have no image and no way to "tell" it what url pop up to go to..can anyone help!!!
Thanks Stef
Jul 26 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

7
by: George Hernandez | last post by:
I have a site on a set of Linux Servers where my site is PHP enabled and I would like to prevent people from externally linking to content on my site and replace it with a warning image. I've...
7
by: Steven T. Hatton | last post by:
Is there anything that gives a good description of how source code is converted into a translation unit, then object code, and then linked. I'm particularly interested in understanding why putting...
3
by: Saurabh Aggrawal | last post by:
Hi, I am porting an application for 64-bit AMD processor and while linking the application i am getting the following errors: Processing directory uidll... Linking DLL...
20
by: Steven T. Hatton | last post by:
I just read this in the description of how C++ is supposed to be implemented: "All external object and function references are resolved. Library components are linked to satisfy external...
1
by: Joannes Vermorel | last post by:
I am currently trying to port a small open source scientfic library written in C++ to .Net. The code (including the VS solution) could be found at http://www.vermorel.com/opensource/selfscaling.zip...
4
by: Sanjay Kumar | last post by:
Folks ! I am working with VC++ after a long time and having problem linking latest xerces 2.7 in VC++ 2005 Express Edition. I have done following: 1. downloaded and unpacked the the...
0
by: Adam Clauss | last post by:
I have managed C++ library (is bridging between a Win32 .dll and a C# application). All was well when compiled under VS2003, but I am running into a series of linking errors when compiling...
0
by: Philip Lowman | last post by:
I am in the process of trying to migrate a couple of build solutions to Visual Studio Express 2005 from VS 2003 Professional and I am running into a weird C/C++ runtime library linking issue when...
5
by: eberesche | last post by:
Hello, as a novice in ASN.1 I have me to a project in C ++ under use of ASN.1 - structures risquély. One of my colleagues means, this would deal something with masochism ;-). Result should be a DLL...
0
by: dotyet | last post by:
Hi Everyone, I am trying to build a DB2 UDB UDF which can perform regex over the table data. The user defined function will call an external .dll file to do the task. I am referring to the...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.