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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T03:07:00+00:00 2026-06-09T03:07:00+00:00

I am creating a debugger utility to help me out in debugging without the

  • 0

I am creating a debugger utility to help me out in debugging without the to follow cumbersome process of redeploying and going to all the way to the page to test it.
so I have created the below functions which are called by various buttons.

     function updateTestCode()
    {
        $("script[for='testing']").html('');
        alert('Adding function ' + $('#_testArea').val());
        $("script[for='testing']").append($('#_testArea').val());



    }

function checkCode()
{
    alert('Calling Function ');
    try{
        validateFields();
    }catch(err)
    {
        form.showDebugMsg("Error When Running Script " + err);
    }
}

function generateScriptCode()
{
    $('#_testArea').val($("script[for='testing']").html());
}

Now all I wanted to do is to allow me to update the value of the function below and use it without the need for redeployment.

<script type="text/javascript" for='testing'>
function validateFields()
{
    alert('Hello World');

}</script>

Now the problem is that Firefox is able to update the code (IE throws error) and retrieve it. But when I try to click and execute the script it still show result of the old function.

Any Ideas what I might be doing wrong???

  • 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-06-09T03:07:03+00:00Added an answer on June 9, 2026 at 3:07 am

    This is happening because you’re using the same script tag and changing the inner text. You have to add a new script tag.

    scriptContent = "... function ...";
    
    // delete old tag
    $("#testScript").remove();
    
    // add a new one
    $("<script id='testScript'/>").text(scriptContent).appendTo("head");
    

    Also, you cannot use append() to add text to an element like you’re doing on your updateTestCode() function. You have to use the text().

    // use text(), not append()
    $("script[for='testing']").text($('#_testArea').val());
    

    Here an working example:
    http://jsfiddle.net/MtY3h/

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

Sidebar

Related Questions

I'm creating the site http://Meer.li and when I run it through facebook debugger -
I am in process of creating my first app and have some confusion over
I'm making a mobile site using Dashcode to help me creating better UIs, but
I'm trying to follow this tutorial, but VS debugger keep asking me for a
I'm new to creating a rails application. I'm going through this tutorial , and
I am creating a master page for admin-side of my application, which is using
I'm creating an Activity Library in Visual Studio 11 Beta (although I've repeated all
I need some help finding and using a good debugger for asm code assembled
Creating a class at runtime is done as follows: klass = Class.new superclass, &block
Creating an a app, where I store bunch of photos in the drawable folder,

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.