Forum Moderators: open

Message Too Old, No Replies

dragNdrop link problem

Link cannot be dragged to Links or Favorites

         

erenshte

1:24 am on Oct 21, 2004 (gmt 0)

10+ Year Member



One of my pages contains the following link that contains JavaScript and this link should be dragged to Links or Favorites:

<a href="javascript:void(open('http://www.wishtreeonline.com/AddToWishList.pl?'+location.href, 'AddToWishList', 'height=245,width=446,left=390,top=320, location=no, scrollbars=no, menubars=no, toolbars=no, resizable=yes'));">AddYourWish</a>

It works fine, but for some reason cannot be dragged in Links toolbar (in Internet Explorer). It was
possible to drag it several days ago and it works fine on Netscape. I also am able to right click on it
and add it to Favorites, but cannot drag it.

It was working fine several days ago, before Cumulative Security Update for IE have been installed (KB834707)
The known issue is that this update blocks dragNdrop operations for links that include non-HTTP URLs.

I also tested this link on the computer that doesn't have this update and it works fine.

It is urgent! Thanks a lot. Dr.Roman Erenshteyn

Bernard Marx

7:57 am on Oct 21, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



The known issue is that this update blocks dragNdrop operations for links that include non-HTTP URLs.

Haven't you succinctly answered your own question?

erenshte

12:18 pm on Oct 21, 2004 (gmt 0)

10+ Year Member



I know.
But there should be the way to
work around this blocking feature.
Microsoft sucks! I saw at least
20 websites that are not working
properly.

Thanks anyway.

Rambo Tribble

1:04 pm on Oct 21, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Keep your link an HTTP and have your JavaScript, too:

<a href="http://www.whatever.com" onclick="window.open('http://www.whatever.com','','height=~etc.');return false;">Link text</a>

erenshte

1:35 pm on Oct 21, 2004 (gmt 0)

10+ Year Member



There is one problem. Look at my JavaScript in my first post. It opens a window and calls perl script
that takes URL of the page I'm currently visiting
as environment variable. If I follow your advise
it will capture the url of the page I'm linking to
(page of my own domain)

Dr.Roman Erenshteyn

Rambo Tribble

3:16 pm on Oct 21, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I'm not sure I follow your explanation, but this should cover extracting either href:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>Untitled</title>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1">
</head>
<body>
<a href="http://www.someURL.com" onclick="alert(window.location.href);return false;">Test 1</a>
<a href="http://www.someURL.com" onclick="alert(this.href);return false;">Test 2</a>
</body>
</html>

Rambo Tribble

10:29 pm on Oct 21, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Here's a link to an article regarding IE and drag 'n' drop. Perhaps your problems relate to an unannounced attempt to mitigate this vulnerability.

[informationweek.com...]

erenshte

4:00 am on Oct 22, 2004 (gmt 0)

10+ Year Member



Thanks,

You gave me some ideas.

Dr.Roman Erenshteyn

erenshte

5:10 am on Oct 22, 2004 (gmt 0)

10+ Year Member



The problem with extracting location.href is that
my website searches for the particular product and
when the product is found it should be saved in the database together with URL. I have developed a perl script that is called from javascript posted above.
location.href is passed to this script as environmental variable. Javascript also creates a window where perl script creates a form. Captured URL
is stored as a hidden field. When user press <save>
all data from the form is saved in database. Alert function in the code you provided displays current url
of my page, not of the page visited.

Dr.Roman Erenshteyn

Rambo Tribble

12:55 pm on Oct 22, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I'm afraid I not seeing how you are getting the "page visited" URL to begin with. Location.href should always return the value of the current page in the browser window. Any script originating on your page should not be able to read the href of a page from another domain as per the Same Origin Policy. If the "page visited" is linked to from your page, then it is possible to read the href of the link.

erenshte

1:11 pm on Oct 22, 2004 (gmt 0)

10+ Year Member



You absolutely right about Same Origin Policy. But
I developed a perl script that overcomes this problem.
It is easy to capture url of the page visited directly
from my site, but to capture url of any page visited
and save it in the database is a challenge. You can
add it to favorites and then paste it into some form,
or you can copy and paste it to the same form. But my users just have to click on the link in <Links> toolbar and the page url is saved. The only thing user need to do is to place this link to Links toolbar.
This link contains javascript with embedded perl script that captures location.href as an environmental
variable. Then the url can be processed. Below is this
link's script (actually, it opens a pop-up window.

javascript:void(open('http://www.wishtree.com/AddToWishList.pl?'+location.href, 'AddToWishList', 'height=245,width=446,left=390,top=320, location=no, scrollbars=no, menubars=no, toolbars=no, resizable=yes'));

Sincerely, Dr.Roman Erenshteyn