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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T09:49:02+00:00 2026-05-18T09:49:02+00:00

Thanks to this answer I was able to get javascript to execute when being

  • 0

Thanks to this answer I was able to get javascript to execute when being loaded via an ExtJS AJAX call.

However, the following code does not work the same in all browsers (on mac):

  • chrome: works, alert pops up
  • safari: works, alert pops up
  • firefox: works, but only when Firebug is enabled, when Firebug is not enabled, the script is ignored

How can I get javascript to execute via AJAX call in Firefox without having Firebug installed?

Ext.onReady(function(){

    var menuItemStart = new Ext.Panel({
        id: 'panelStart',
        title: 'Start',
        html: 'This is the start menu item.',
        cls:'menuItem'
    });

    var menuItemApplication = new Ext.Panel({
        id: 'panelApplication',
        title: 'Application',
        html: 'this is the application page',
        cls:'menuItem'
    });

    var regionMenu = new Ext.Panel({
        region:'west',
        split:true,
        width: 210,
        layout:'accordion',
        layoutConfig:{
            animate:true
        },
        items: [ menuItemStart, menuItemApplication ]
    });

    var regionContent = new Ext.Panel({
        id: 'contentArea',
        region: 'center',
        padding:'10',
        autoScroll: true,
        html: 'this is the content'
    });

    new Ext.Viewport({
        layout: 'border',
        items: [ regionMenu, regionContent ]
    });

    menuItemStart.header.on('click', function() {
        Ext.Ajax.request({
            url: 'content/view_start.php',
            success: function(objServerResponse) {
                regionContent.update(objServerResponse.responseText);
            }
        });
    });

    menuItemApplication.header.on('click', function() {             
        Ext.Ajax.request({
            url: 'content/view_application.php',
            success: function(objServerResponse) {
                var responseText = objServerResponse.responseText;
                console.log(responseText);
                regionContent.update(responseText);
                var scripts, scriptsFinder=/<script[^>]*>([\s\S]+)<\/script>/gi;
                while(scripts=scriptsFinder.exec(responseText)) {
                    eval(scripts[1]);
                }
            }
        });

    });
});

The base that is being loaded:

<script type="text/javascript">
    alert('inside application view');
</script>
<?php
echo 'this is the application view at ' . date('Y-m-d h:i:s');
?>
  • 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-18T09:49:02+00:00Added an answer on May 18, 2026 at 9:49 am

    console.log is your culprit.

    Whenever you’re logging in JavaScript, it’s a good idea to check if console exists before calling it’s functions:

    if(window.console) console.log('whatever');
    

    That way, it will only execute when the console is available.

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

Sidebar

Related Questions

Thanks to the answer on this stackoverflow question I was able to get the
thanks to this answer I was able to determine if Server is listening on
i asked this question before but haven't been able to get an answer.. i
I have a javascript quiz which gets question data via an ajax call to
Thanks in Advance for reading and answer this question. I got button in asp
i've been asked this question and id not know the answer. Thanks for any
UPDATE: Solved. Thanks BusyMark! EDIT: This is revised based on the answer below from
I'm making an AJAX call which returns XML data, and this is my 'success:'
I asked a similar question before but wasn't able to get an answer. Now
I've been able to get jQuery UI Sortable working in Ember.js thanks to @ghemton's

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.