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 6391607
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T03:41:33+00:00 2026-05-25T03:41:33+00:00

I have a jQuery dialog which I fire from a list of items in

  • 0

I have a jQuery dialog which I fire from a list of items in a jTemplate:

<a href="#" class="view-map" id="{$T.Address.AddressCity.Lat}|{$T.Address.AddressCity.Lon}"><img src="/images/iconography/tiny-map.png" width="16" height="16" alt="See this address on a map..." title="See this address on a map..."></img></a>

jQuery:

$('.view-map').live('click', function () {
            $('#map')
                .data('id', $(this).attr('id'))
                .dialog('open')

            ;
            return false;
        });

        $('#map').dialog({
            autoOpen: false,
            resizeable: false,
            position: 'top',
            modal: true,
            width: 650,
            open: function() {
                var location =  $(this).data('id').split('|');
                $(this).load('/components/google/map.aspx?lat=' + location[0] + '&lon=' + location[1]);
            },
            buttons: {
                'Ok': function () {
                    $(this).dialog('close');
                }
            }
        });

When the map.aspx page loads, I want the following javascript to fire (so I can get the map from Google):

function initialize() {
            var myOptions = {
                zoom: 9,
                disableDefaultUI: true,
                center: new google.maps.LatLng(<%=Lat%>, <%=Lon%>),
                mapTypeId: google.maps.MapTypeId.ROADMAP
            };
            var map = new google.maps.Map(document.getElementById('x-map-placeholder'), myOptions);
            document.getElementById('x-map-loader').style.display = 'none';
        }

        function loadScript() {
            alert("I'm away!");
            var script = document.createElement('script');
            script.type = 'text/javascript';
            script.src = 'http://maps.googleapis.com/maps/api/js?sensor=false&callback=initialize';
            document.body.appendChild(script);
        }
        function toLower(s) {
            return s.toLowerCase();
        }
        function toFixed(n) {
            return n.toFixed(0);
        }

        window.onload = loadScript;

Obviously it doesn’t and I think this is because how the dialog is called – I understand that calling a dialog isn’t window.onloading and therefore won’t fire the loadScript, but I’m not sure what to do to get it to fire….

Can anyone help? 🙂

Help is appreciated.

  • 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-25T03:41:34+00:00Added an answer on May 25, 2026 at 3:41 am

    use

    $(function(){
    function to fire 
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a jQuery dialog which loads an external php page. All is working
I have a jquery modal dialog that displays a partial view. The partial view
i have one jquery dialog which can show after click radiobutton. last time it
I have jQuery dialog window, upon some operations I have a blockUI plugin which
i have a jquery Dialog in a partial view: @model JQueryDialogPoc.Models.FeedBack @using (Ajax.BeginForm(GiveFeedback, Home,
I need to style a jQuery-ui-dialog with shadows. I have a sample in which
Morning. I have a form which is rendered inside of a jquery dialog box
I have several Telerik's DropDownList controls which are rendered inside jQuery dialog It is
I have an HTML link that opens a jQuery modal dialog which contains an
I have a dropdown list which is populated via a jquery ajax call when

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.