Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New to the CF scene
    Join Date
    May 2013
    Posts
    5
    Thanks
    1
    Thanked 0 Times in 0 Posts

    how to auto change ( arget="blank )title with ( javascript )

    hi guys this is my 1st post pls help me


    <strong>
    <div id="contentarea">
    <table width="100%" border="0" cellspacing="0" cellpadding="0">
    <tr>
    <td><div align="center"><a href="http://putlocker.com/embed/51536C523E65AC6B" target="blank">putlocker.com/embed/51536C523E...</a></div></td>
    </tr>
    <tr>
    <td><div align="center"><a href="http://vidxden.com/xiif4kxqdpjg" target="blank">vidxden.com/xiif4kxqdpjg</a></div></td>
    </tr>
    <tbody>
    <tr>
    <td width="100%" valign="top"><fieldset>
    <div></div>
    </fieldset></td>
    </tr>
    </tbody>
    </table>
    </div>
    </strong>

    example = http://vidxden.com/xiif4kxqdpjg

    title = target="blank">vidxden.com/xiif4kxqdpjg

    i want all links text to convert = Watch Online

    hope u guys undestand Thanks in advance

  • #2
    Supreme Master coder! Philip M's Avatar
    Join Date
    Jun 2002
    Location
    London, England
    Posts
    18,170
    Thanks
    203
    Thanked 2,549 Times in 2,527 Posts
    Assign the ids "link1" and "link2" to the two divs which contain your links. Then simply change the innerHTML:-

    Code:
    <script type = "text/javascript">
    
    document.getElementById("link1").innerHTML = '<a href="http://putlocker.com/embed/51536C523E65AC6B" target="blank">Watch Online</a>'
    document.getElementById("link2").innerHTML = '<a href="http://vidxden.com/xiif4kxqdpjg" target="blank">Watch Online</a>'
    
    </script>
    But I do not really understand what you are trying to do - why do you not change the text of the link directly?


    Note that the align="center" tag is obsolete and deprecated - use CSS to style the page layout. Likewise The <td> valign attribute is not supported in HTML5.


    "That which seems the height of absurdity in one generation often becomes the height of wisdom in the next". - John Stuart Mill.
    Last edited by Philip M; 05-06-2013 at 08:23 AM.

    All the code given in this post has been tested and is intended to address the question asked.
    Unless stated otherwise it is not just a demonstration.

  • Users who have thanked Philip M for this post:

    ShaNi Ax (05-06-2013)

  • #3
    New to the CF scene
    Join Date
    May 2013
    Posts
    5
    Thanks
    1
    Thanked 0 Times in 0 Posts
    see this image u see links


    i want to show all links to like this auto change text with javascript


    or all links reaplce with image like this


    pls dear Philip M help me i,m doing google from 1 week not get anything i find this forum from google hope i get solution here thanks for reaply

  • #4
    Supreme Master coder! Philip M's Avatar
    Join Date
    Jun 2002
    Location
    London, England
    Posts
    18,170
    Thanks
    203
    Thanked 2,549 Times in 2,527 Posts
    You cannot change the content or appearance of web pages from some other domain using Javascript.

    The Same Origin Policy automatically prevents scripts on one server from accessing properties of documents on a different server. This restriction prevents scripts from, for example, fetching private information such as directory structures or user session history

    Simply stated, the SOP states that JavaScript code running on a web page may not interact with any resource not originating from the same web site.

    All the code given in this post has been tested and is intended to address the question asked.
    Unless stated otherwise it is not just a demonstration.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •