DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

+ Reply to Thread
Results 1 to 2 of 2
  1. #1
    Join Date
    Jun 2008
    Posts
    5

    ActiveXObject help...

    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

    *

  2. #2
    Join Date
    Jun 2008
    Posts
    5

    RE: ActiveXobject 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;http://web.site.url& # 39; target=& # 39;_blank& # 39;>Text</a>'
    so the cell contained:
    <a href="'http://web.site.url'"; 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=http://web.site.url target=_blank>Text</a>'
    so the cell contains:
    <a href="http://web.site.url"; 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.

    *
    Last edited by LitlGreyCells; 06-13-2008 at 08:51 PM.

Similar Threads

  1. ActiveXObject versus CreatObject
    By Michael Arbel in forum Java
    Replies: 2
    Last Post: 02-14-2001, 03:22 PM
  2. ActiveXObject versus CreatObject
    By Michael in forum Java
    Replies: 0
    Last Post: 12-06-2000, 04:13 PM

Bookmarks

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
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


Top DevX Stories

Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL


Sponsored Links