Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to reset local file access back to "web"

Status
Not open for further replies.

MALeonard

Technical User
Mar 27, 2005
8

I have written a (client side) javascript using:
objHttpReq = new ActiveXObject('Msxml2.XMLHTTP');

Then do the OPEN/GET/SEND/etc on a local file.
Everything works fine, except...

Now all the regular HTTP links on the page-
<a href="......">xxxx</>

Auto add "file:///...path..." to the front of the HREF
when hover over/click on.

How to cancel/reset back from "local" to "web" mode?

Am doing...
objHttpReq.close;
objHttpReq = false;
...no help

*
 
Figured it out...
Nothing to do with the ActiveXobject.

Had to do with the way I was populating my cell...
was adding single-quotes(') around the href parms,

and the builtin method(?) was then also adding dbl-quotes(") around them.

====
var oCell;
var newRow = document.getElementById('symbtbl').insertRow(-1); // add at end

oCell = newRow.insertCell(0);

// javascript uses sngl-quotes for text, and dbl within causes problems...
//bad...
// Apostrophe = & # 39; (note- had to imbed spaces to prevent this board from converting on display)
oCell.innerHTML = '<a href=& # 39; # 39; target=& # 39;_blank& # 39;>Text</a>'
so the cell contained:
<a href="' target="'_blank'">Text</a>
Which caused the browser to treat the link as a local file, instead of an URL.

//good...
oCell.innerHTML = '<a href= target=_blank>Text</a>'
so the cell contains:
<a href=" target="_blank">Text</a>
And now the browser treats correctly - an URL

Note- if populate including the dbl-quotes (& # 34 or & q uot )
the method still adds additional dbls around the parms,
but the browser appears to treat OK.

*
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top