Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6131489
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T16:58:53+00:00 2026-05-23T16:58:53+00:00

Following is the code:- <script type=text/javascript> var timer = 150; var currentWindow; $(document).ready(function() {

  • 0

Following is the code:-

    <script type="text/javascript">

var timer = 150;
var currentWindow;
$(document).ready(function() 
{
    $("#creditme").button({
        icons: { primary: "ui-icon-check" }
    }).hide();
    $("#viewad").button({
        icons: { primary: "ui-icon-play" }
    }).hide();
    $("#progressbar").progressbar({value: 0}).hide();

    var time;
    var id;
    var title;
    var url;

    $('.googlep-advertisement').bind('click', function()
    {       
        id = $(this).attr('id');
        title = $(this).text();
        url = $('#yturl-'+id).text();
        timer = $('#ytime-'+id).text();
        $("#dialog-message").dialog({
            modal: true,
            width: 700,
            title: title,
            resizable: false,
            draggable: false,
            beforeClose: function() { clearAd(); }
        });
        if (!$("#progressbar").is(":visible") && !$("#creditme").is(":visible")) 
        {
            $("#viewad").show();
        }
    });


    $("#viewad").bind('click',function() {
       $.get("googlep_credit.php" + '?start=' + id);
       $("#viewad").hide();
       $("#progressbar").progressbar('value', 0).show();
       currentWindow = window.open(url, 'videoad', 'height=480,width=640', false);
       window.blur();
       window.focus();
       progresscount(timer);
    });
    $("#creditme").click(function() {
        $.get("googlep_credit.php" + '?id=' + id);
        $("#creditme").hide();
        $("#dialog-message").dialog('close');
        $("#"+id).parent().parent('tr').fadeOut('slow');
    });
    function progresscount(time) 
{
    if(time == 0) 
    {
        if(isWindowClosed() == true)
        {
            alert('You closed the popup before timer reached zero or you are using popup-blocking software.');  
            $("#dialog-message").dialog('close');
        }
        else
        {
            $("#creditme").html('<g:plusone callback="plusone_vote" href="'+url'"></g:plusone>');
            $("#creditme").show();
        }   
        $("#progressbar").hide();
    } 
    else 
    {
        time--;
        $("#progressbar").progressbar('value', parseInt((timer - time) * 100 / timer));
        setTimeout(function() { progresscount(time) }, 100);
    }
}
});

function isWindowClosed()
{
    if (!currentWindow || typeof currentWindow == 'undefined' || currentWindow && currentWindow.closed) 
    {
        return true;
    }
    else
    {
        return false;
    }
}



function clearAd()
{

}
</script>
<style>
.dialog-message {

}
</style>

<div id="dialog-message" class="dialog-message" title="View Video" style="display:none">
    <p>

        <center>
            <button id="viewad" style="ui-helper-hidden">Click here to view the video</button>
            <div id="progressbar"></div>
            <button id="creditme" style="ui-helper-hidden">Test</button>
        </center>
    </p>
</div>

Nothing wrong with the code.
The problem is:-
http://dl.dropbox.com/u/14384295/70.jpeg

When checked with google chrome inspect element,
The code appears as
http://dl.dropbox.com/u/14384295/71.jpeg

Correctly working will appear as > http://dl.dropbox.com/u/14384295/72.jpeg

It seems that the code is not being converted by the google js which is in the portion. I am sorry if i have been confusing.

I may probably be doing the addition of ‘url’ var incorrectly

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T16:58:54+00:00Added an answer on May 23, 2026 at 4:58 pm

    I’m pretty sure your problem lies in this line:

    $("#creditme").html('<g:plusone callback="plusone_vote"></g:plusone>');
    

    You are dynamically adding the <g:plusone> element after the Google +1 script has been run, so nothing happens.

    To solve it, simply put the +1 markup in the html from the beginning so the +1 script can find it and render it, and only call $("#creditme").show(); when you need to show it.

    <button id="creditme" style="ui-helper-hidden">
        <g:plusone callback="plusone_vote"></g:plusone>
    </button>
    

    If you want to dynamically change the URL after page load, check out the examples from the Google documentation. It will allow you to load the button explicitly.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following code: <script type=text/javascript> $(document).ready(function() { $(#Save).click(function() { $.post(url, { data:
I have the following code: <script type=text/javascript> function SubmitForm() { form1.submit(); } function ShowResponse()
I have the following code: <script> $(document).ready(function() { $('.toggle_section').click(function(e){ parent = $(e.target).closest(div) objChild =
I've got the following code: <code><html> <body><br> <script type=text/javascript src=http://code.jquery.com/jquery-1.4.2.min.js /> <script type=text/javascript> alert(debug);
I have the following code that works fine in IE: <HTML> <BODY> <script language=JavaScript>
I'm having troubles with the following code: <link type=text/css href=http://jqueryui.com/latest/themes/base/jquery.ui.all.css rel=stylesheet /> <script type=text/javascript
i'm using the following code to submit a form: function submitfilter(){ alert(in here); var
I have the following code where the function codeaddress geocodes the text feild value
The following code produces function (value) { if (value === undefined) { var elem
I have the following code in action script 3: async.addResponder(new Responder(result, defaultFaultHandler)); result is

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.