www.webdeveloper.com
Page 2 of 2 FirstFirst 12
Results 16 to 17 of 17

Thread: document object works in IE but not in FF

  1. #16
    Join Date
    Sep 2012
    Posts
    17
    Thanks Troy for your reply. I'm trying to replace \ with : in code below, but it's no working. Any help or advise as usual is greatly appreciated.

    cmCreatePageviewTag("<<label id="myDiv1"></label>>","<<label id="myDiv2"></label>>");

    <script type="text/javascript">

    document.getElementById("myDiv1").innerHTML = window.location.pathname;

    document.getElementById("myDiv2").innerHTML = top.location.pathname.replace(/\\/g,":").replace( /\/[^\/]*$/, ":" );

    alert("cmCreatePageviewTag(\"<" + window.location.pathname + "," + top.location.pathname.replace(/\\/g,":").replace( /:[^:]*$/, ":" ) + ">\")");

    </script>

  2. #17
    Join Date
    Sep 2012
    Posts
    17
    Nevermind guys, here is the solution below plus uppercase function:


    cmCreatePageviewTag("<<label id="myDiv1"></label>>","<<label id="myDiv2"></label>>");

    <script type="text/javascript">

    document.getElementById("myDiv1").innerHTML = window.location.pathname.split('/').join(':').toUpperCase();

    document.getElementById("myDiv2").innerHTML = top.location.pathname.replace(/\\/g,"/").replace( /\/[^\/]*$/, "" ).split('/').join(':').toUpperCase();

    </script>

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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



Recent Articles