Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Web Programming > JavaScript > Javascript How-To
Password Reminder
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Javascript How-To Ask your "How do I do this with Javascript?" questions here.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Javascript How-To section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old November 28th, 2004, 11:38 PM
Authorized User
Join Date: Jul 2004
Location: , , .
Posts: 40
Thanks: 0
Thanked 0 Times in 0 Posts
Default sending the src for an image to a new window...

How can I send the name of the src file to a new window that I am opening up....I want to show an enlarged view of an image when clicked - so I just want to send the name of the image file to the new page I am opening up in a new window....any ideas...

Reply With Quote
  #2 (permalink)  
Old November 29th, 2004, 05:35 AM
joefawcett's Avatar
Wrox Author
Points: 9,763, Level: 42
Points: 9,763, Level: 42 Points: 9,763, Level: 42 Points: 9,763, Level: 42
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
Join Date: Jun 2003
Location: Exeter, , United Kingdom.
Posts: 3,074
Thanks: 1
Thanked 38 Times in 37 Posts

You could have an onclick in the image, onclick="showFullImage(this)" for example. The showFullImage function is like:
function showFullImage(Image)
  var sUrl = "<your url goes here";
  sUrl += "?image=" + encodeURIComponent(Image.src);
var oNewWindow = window.open(sUrl, "NewWin", "<feature list here>");
If you think ythe browser won't support encodeURIComponent then use the older escape function instead, or try both:
function encodePath(Data)
  if (window.encodeURIComponent)
    return encodeURIComponent(Data);

  return escape(Data);


Joe (Microsoft MVP - XML)
Reply With Quote

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
sending and retrieving image to/from sql mosi C# 2005 1 May 10th, 2008 07:51 AM
chapter 7 js error when changing image src grom BOOK: Beginning Ajax with ASP.NET 1 January 3rd, 2008 12:41 PM
chapter2-src\src\ch02\sample5 _ need help M7777777bill BOOK: Professional Java Development with the Spring Framework 0 June 14th, 2006 10:00 PM
sending src name to new document elladi Classic ASP Basics 3 November 29th, 2004 11:42 PM
Sending key strokes to a window geofff Visual C++ 0 September 9th, 2004 07:19 AM

All times are GMT -4. The time now is 08:32 AM.

Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.