DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: ActiveXObject help...

  1. #1
    Join Date
    Jun 2008

    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 = false; help


  2. #2
    Join Date
    Jun 2008

    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...
    // 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.

    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.

    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, 04:22 PM
  2. ActiveXObject versus CreatObject
    By Michael in forum Java
    Replies: 0
    Last Post: 12-06-2000, 05:13 PM

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
Latest Articles
Questions? Contact us.
Web Development
Latest Tips
Open Source

   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center