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

  • SEARCH
  • Home
  • 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 6646707
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T00:26:57+00:00 2026-05-26T00:26:57+00:00

I’m trying to get a javascript based world clock to run inside a pop

  • 0

I’m trying to get a javascript based “world clock” to run inside a pop up div that is shown with jQuery.
It works great when I look at it in the Dreamweaver Live View. But when I upload it to my server, the Javascript showClock(clockobj), which contains a document.write(…) command, executes immediately and rewrites the entire screen with the map. So, I took the showClock(clockobj) call out of the worldclock.html javascript and put it in the jQuery handler that opens the div. The map comes up with a click. But its not in the div. It takes over the whole screen.

How do I get it to display INSIDE the div, like all of the other buttons do on the page? (Tips, Converter, Add, Edit, Copy, etc,)

Here is the link, if you want to see what I’m doing:

http://www.bizzocall.com/cp-ManagePhone.php

Here’s the JS:

<script src="http://www.clocklink.com/embed.js"></script><script type="text/javascript" language="JavaScript">
clockobj=new Object;clockobj.clockfile="world001-blue.swf";
clockobj.TimeZone="PST";
clockobj.width=480;
clockobj.height=250;
clockobj.wmode="transparent";

</script>

Here’s the jQuery:

<script type="text/javascript">
        $(function(){
            // Dialog box           
            $('#worldclock').dialog({
                autoOpen: false,
                width: 540,
                buttons: {
                    "Cancel": function() { 
                        $(this).dialog("close");

                    } 
                }
            });

            // Dialog Link
            $('#worldclockbtn').click(function(){
                $('#worldclock').dialog('open');
                showClock(clockobj);
                return false;
            });
        });
    </script>

The HTML:

<div id="worldclock"  class="DialogBox">
<?php require_once('worldclock.html'); ?>
</div>
<div class="tiptxt" id="worldclockbtn" >WORLD CLOCK
        <div class="arrowInCircle"></div>
</div>
  • 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-26T00:26:58+00:00Added an answer on May 26, 2026 at 12:26 am

    Firstly get rid of one of your jqueries – you have several and different versions
    they may be the reason for this error:

    $(“#picker”).farbtastic is not a function
    Source File: http://www.bizzocall.com/cp-ManagePhone.php
    Line: 26

    To handle a document.write, override it

    var oldWrite = document.write;
    var stringToWrite = ""; // this is polluting the window scope, but is for demo purposes ok
    document.write=function(str) {
      stringToWrite+=str
    }
    

    and use $(“#someDiv”).html(stringToWrite)

    but looking at the JS, you can also just replace

    function showBanner(BannerLink){
        document.write(BannerLink);
    }
    

    with

    function showBanner(BannerLink){
      $("#someDiv").html(BannerLink);
    }
    

    update: replace the whole external script with

    function showClock(obj){
    
    //Aded by Takeshi Sugimoto on 2008/05/01 for SSL
    var str = '';
    
    if(obj.ssl == '1'){
        str = '<embed src="https://secure.clocklink.com/clocks/';
    }
    else{
        str = '<embed src="http://www.clocklink.com/clocks/';
    }
    //--
    
        str += obj.clockfile;
        str += "?";
    
        for( prop in obj ) {
            if( 'clockfile' == prop 
                || 'width' == prop
                || 'height' == prop
                || 'wmode' == prop
                || 'type' == prop
            ) continue;
    
            //Added by takeshi on 2007/01/29 (to display mutibyte chars by using URL encoding)
            if(prop == "Title" || prop == "Message"){
                str += ( prop + "=" + obj[prop] + "&" );
            }
            else{
                str += ( prop + "=" + _escape(obj[prop]) + "&" );
            }
            //--
        }
        str += '" ';
        str += ' width="' + obj.width + '"';
        str += ' height="' + obj.height + '"';
        str += ' wmode="' + obj.wmode + '"';
        str += ' type="application/x-shockwave-flash">';
    
        return str ;
    }
    
    function _escape(str){
        str = str.replace(/ /g, '+');
        str = str.replace(/%/g, '%25');
        str = str.replace(/\?/, '%3F');
        str = str.replace(/&/, '%26');
        return str;
    }
    

    and do

    $(‘#worldclock’).html(showClock(clockobj)).dialog…..

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

Sidebar

Related Questions

Basically, what I'm trying to create is a page of div tags, each has
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I am trying to understand how to use SyndicationItem to display feed which is
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I used javascript for loading a picture on my website depending on which small
I have a jquery bug and I've been looking for hours now, I can't
I've got a string that has curly quotes in it. I'd like to replace
I have a French site that I want to parse, but am running into
I am trying to loop through a bunch of documents I have to put

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.