...

View Full Version : Opening in Same window - with PHP getString



creativkook
06-07-2007, 03:06 AM
Ok, I have a site that requires a horizontal scrolling image viewer. I want to be able to have the user click on the image and open the same page but with the variable I need in the getString so I can pull the information out of the database that will go along with that picture. I was wondering how I would change it from what it does now (which is open a new window) to keeping it in the same window with everything else I need. Thanks!


function onclickHandler(e)
{
// Browser compatibility code
var targ;
if (!e){var e = window.event;}

if (e.target)
{ targ = e.target;
var xpos=(e.pageX); var ypos=(e.pageY);}

else if (e.srcElement)
{ var xpos=(event.x); var ypos=(event.y);
targ = e.srcElement;}

// Strip file name from image src
var spath=targ.getAttribute('src');
wholePathLength=spath.length;
strippedPathLength=spath.substring(0,spath.lastIndexOf("/")).length;
ifm= spath.substring(strippedPathLength+1,wholePathLength);
// Store file name in holder for use by popup windoow
document.getElementById('fileNameHolder').value=ifm;
// Open the window at location of thumbnail image
var pos = "left="+xpos+",top="+ypos;
window.open("imageViewerPopup.htm","imageWindow","width=18,height=18,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,"+pos);
}



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum