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 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Mar 2013
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    How to Reload a javascript once

    Hello,

    Actually I am using Ajax in my wordpress site. The thing is when i open a post having a youtube video using ajax the video doesn't appear.

    So what i want is, I want a reload code or a code which will reload the youtube video after the page loads using jQuery.

    The script that i use to post youtube videos in my site is
    Code:
    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/swfobject/2.2/swfobject.js">
    					var params = { allowScriptAccess: "always", wmode: "transparent" };
    					swfobject.embedSWF("' . htmlentities('http://www.youtube.com/embed/'.$atts['id'].'?enablejsapi=1&version=3&playerapiid='.$uuid.'&rel=0&controls=1&showinfo=1') . '", "'.$uuid.'", "'.$width.'", "'.$height.'", "9.0.0", null, null, params);
    				</script>
    				<div id="cp_container" class="cp_youtube">
    					<div id="'.$uuid.'"></div>
    				</div>
    I could have used iframe, but because the swfobject in the script above is linked with another function, i can not replace it.

    I am using the plugins Advanced Ajax Page loader and the Youtube Module of Cubepoints.

  • #2
    New to the CF scene
    Join Date
    Feb 2013
    Location
    new delhi
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Hi dear ;

    I think . you can use this code#### location.reload();
    method .

    And in other term

    How to Reload the Page With JavaScript

    There are several ways to reload the current page using a button or other trigger. The examples below use a button click to reload the page but you can use a text hyperlink or any trigger you like.

    <input type="button" value="Reload Page" onClick="window.location.reload()">

    regards
    prem

  • #3
    New to the CF scene
    Join Date
    Mar 2013
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Actually I just want to reload the swfObject function in that javascript... I guess that will solve all the problems...

    How can i do it jQuery... I urgently need to know...

    I tried many things but i am unable to do it


  •  

    Posting Permissions

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