Anchor element doesn't work with full path

Discussion in 'ASP .Net' started by AAaron123, Mar 14, 2009.

  1. AAaron123

    AAaron123 Guest

    <a
    href="JavaScript:eek:penWindow('Aerial','Images/Aerial-View.jpg',900+80,698+80)">Aerial
    view of the grounds</a>

    <a href="JavaScript:eek:penWindow('Aerial','I:/My Documents/Visual Studio
    2008/WebSites/Louis/Images/Aerial-View.jpg',900+80,698+80)">Test Aerial view
    of the grounds</a>



    The first one works OK.



    The second one produces the small square with a square, circle and triangle
    inside. Guess that means the image is not being displayed.

    I'm quite sure there is no typo in the second path because I use windows
    explorer to find the file and then cut and pasted the path.

    The lines are next to each other in the markup just as shown above.



    Can you explain that?



    Thanks
    AAaron123, Mar 14, 2009
    #1
    1. Advertising

  2. AAaron123

    bruce barker Guest

    openWindow() can not access the local client machine file system (unless
    full trust is set and security modified). it should a url on the server.


    -- bruce (sqlwork.com)

    AAaron123 wrote:
    > <a
    > href="JavaScript:eek:penWindow('Aerial','Images/Aerial-View.jpg',900+80,698+80)">Aerial
    > view of the grounds</a>
    >
    > <a href="JavaScript:eek:penWindow('Aerial','I:/My Documents/Visual Studio
    > 2008/WebSites/Louis/Images/Aerial-View.jpg',900+80,698+80)">Test Aerial view
    > of the grounds</a>
    >
    >
    >
    > The first one works OK.
    >
    >
    >
    > The second one produces the small square with a square, circle and triangle
    > inside. Guess that means the image is not being displayed.
    >
    > I'm quite sure there is no typo in the second path because I use windows
    > explorer to find the file and then cut and pasted the path.
    >
    > The lines are next to each other in the markup just as shown above.
    >
    >
    >
    > Can you explain that?
    >
    >
    >
    > Thanks
    >
    >
    >
    >
    >
    bruce barker, Mar 15, 2009
    #2
    1. Advertising

  3. AAaron123

    AAaron123 Guest

    openWindow is just a JavaScript function.
    So the question boils down to:
    Why does a function work OK when I call it with:
    'Images/Aerial-View.jpg'
    But not when I call it with the full path :
    'I:/My Documents/Visual Studio ...

    If JavaScript had the equivalent of ~ client side I think I'd be all set.
    Of if I could set a Session variable equal to ~ I think I'd be all set.

    I think I could use something like:
    <img src="http://www.contoso.com/MyApplication/Images/SampleImage.jpg" />
    on the host but it would be wrong when debugging.

    I tried:
    '/Images/Aerial-View.jpg'
    But that didn't work.Maybe something else is the problem.
    If I knew the correct way to reference the Images folder which resides ib
    the root folder
    (that is the same folder that Default.aspx resides in) I could precede
    better.


    Thanks



    "bruce barker" <> wrote in message
    news:...
    > openWindow() can not access the local client machine file system (unless
    > full trust is set and security modified). it should a url on the server.
    >
    >
    > -- bruce (sqlwork.com)
    >
    > AAaron123 wrote:
    >> <a
    >> href="JavaScript:eek:penWindow('Aerial','Images/Aerial-View.jpg',900+80,698+80)">Aerial
    >> view of the grounds</a>
    >>
    >> <a href="JavaScript:eek:penWindow('Aerial','I:/My Documents/Visual Studio
    >> 2008/WebSites/Louis/Images/Aerial-View.jpg',900+80,698+80)">Test Aerial
    >> view of the grounds</a>
    >>
    >>
    >>
    >> The first one works OK.
    >>
    >>
    >>
    >> The second one produces the small square with a square, circle and
    >> triangle inside. Guess that means the image is not being displayed.
    >>
    >> I'm quite sure there is no typo in the second path because I use windows
    >> explorer to find the file and then cut and pasted the path.
    >>
    >> The lines are next to each other in the markup just as shown above.
    >>
    >>
    >>
    >> Can you explain that?
    >>
    >>
    >>
    >> Thanks
    >>
    >>
    >>
    >>
    AAaron123, Mar 15, 2009
    #3
  4. AAaron123

    AAaron123 Guest

    "Mark Rae [MVP]" <> wrote in message
    news:...
    > "AAaron123" <> wrote in message
    > news:...
    >
    >> Why does a function work OK when I call it with:
    >> 'Images/Aerial-View.jpg'

    >
    > Because that's a valid URL.
    >
    >> But not when I call it with the full path :
    >> 'I:/My Documents/Visual Studio ...

    >
    > Because that isn't...
    >
    >> If JavaScript had the equivalent of ~ client side I think I'd be all set.
    >> Or if I could set a Session variable equal to ~ I think I'd be all set.

    >
    > <script type="text/javascript">
    > var strRoot = '<%=Request.Url.GetLeftPart(UriPartial.Authority) +
    > ResolveUrl(Request.ApplicationPath)%>';
    > </script>
    >
    >
    > --
    > Mark Rae
    > ASP.NET MVP
    > http://www.markrae.net




    Trying to understand. I find that
    URL can be an HTML document on the web, it can be an image file...
    open (URL, windowName[, windowFeatures])

    FROM http://www.ietf.org/rfc/rfc1738.txt:

    A file URL takes the form:

    file://<host>/<path>

    where <host> is the fully qualified domain name of the system on
    which the <path> is accessible, and <path> is a hierarchical
    directory path of the form <directory>/<directory>/.../<name>.

    <host> can be the empty string
    1) 'Images/Aerial-View.jpg' looks like a file url with an empty host
    but where is the "file://" and the slash in front of <path>?

    2)Also, is 'Images/Aerial-View.jpg' the same as
    '/Images/Aerial-View.jpg' ?

    Finally, I assume the open url does not have to be a file url.
    It could be an HTTP url.

    3)How does open know what I intended if I do not include either HTML or
    FILE?

    4)The directory path definition does appear to admit to a device name.
    Isn't a device name needed?

    Your suggestion appears to produce an http url so I could simply move on but
    the confusion indicated by the above lingers.



    Thanks a lot



    >
    AAaron123, Mar 16, 2009
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Oren
    Replies:
    1
    Views:
    529
    Michael D. Ober
    Apr 29, 2007
  2. Bernhard Sturm

    #top anchor doesn't work in FF

    Bernhard Sturm, Oct 31, 2007, in forum: HTML
    Replies:
    25
    Views:
    3,184
    dorayme
    Nov 1, 2007
  3. Tilman
    Replies:
    0
    Views:
    403
    Tilman
    Mar 19, 2008
  4. Smarty

    Can't Get Full Path From File Element

    Smarty, Nov 14, 2006, in forum: Javascript
    Replies:
    5
    Views:
    207
    Randy Webb
    Nov 14, 2006
  5. odelya
    Replies:
    6
    Views:
    175
    Thomas 'PointedEars' Lahn
    Feb 13, 2008
Loading...

Share This Page