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
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
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old November 28th, 2004, 10: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, 04: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
Default

You could have an onclick in the image, onclick="showFullImage(this)" for example. The showFullImage function is like:
Code:
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:
Code:
function encodePath(Data)
{
  if (window.encodeURIComponent)
  {
    return encodeURIComponent(Data);

  }
  return escape(Data);
}

--

Joe (Microsoft MVP - XML)
Reply With Quote
Reply


Thread Tools
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 11:41 AM
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 10: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 02:41 PM.


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