/    Sign up×
Community /Pin to ProfileBookmark

Display images not in root in Javascript Popup

Hi ,

I am trying to display some images which are not in my root directory. Lets say the image path is C:UsersPublicPicturesSample Pictures and my website is at c:/xampp/htdocs/test.

I have been able to get the path of the Images using Directory Iterator. Now I need to display each of these images in a popup. For that I am using the following Javascript

[CODE]function newPopup(url) {
var path = “file:///”
popupWindow = window.open(
path+url,’popUpWindow’,’height=700,width=800,left=10,top=10,resizable=yes,scrollbars=no,toolbar=no,menubar=no,location=no,directories=no,status=yes’)
}[/CODE]

and I am calling it from MY php fille as

[code=php]
echo ‘<td width=”150″><a href=”JavaScript:newPopup(”.$url.”);”>ScreenShot</a></td>’;[/code]

where $url is path of file as C:/Users/Public/Pictures/Sample Pictures/001.jpg.

But the popup does not even open. What am I doing wrong here

to post a comment
PHP

1 Comments(s)

Copy linkTweet thisAlerts:
@ankuj_guptaauthorApr 23.2013 — I changed the javascript to
[CODE]function newPopup(url) {
popupWindow = window.open(
path+url,'popUpWindow','height=700,width=800,left=10,top=10,resizable=yes,scrollbars=no,toolbar=no,menubar=no,location=no,directories=no,status=yes')
}[/CODE]


Now the pop up opens but the browser displays the firefox does not understands the protocol to open the file.
×

Success!

Help @ankuj_gupta spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.4,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...