www.webdeveloper.com
Results 1 to 2 of 2

Thread: Display images not in root in Javascript Popup

Hybrid View

  1. #1
    Join Date
    Apr 2013
    Posts
    4

    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:\Users\Public\Pictures\Sample 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')
    }
    and I am calling it from MY php fille as
    PHP Code:
    echo '<td width="150"><a href="JavaScript:newPopup(\''.$url.'\');">ScreenShot</a></td>'
    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

  2. #2
    Join Date
    Apr 2013
    Posts
    4
    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')
    }
    Now the pop up opens but the browser displays the firefox does not understands the protocol to open the file.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles