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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T01:01:09+00:00 2026-06-12T01:01:09+00:00

I have an input on my index page: <input type=button name=goReplaceAll value=Go id=allReplaceGo style=cursor:hand;

  • 0

I have an input on my index page:

<input type="button" name="goReplaceAll" value="Go" id="allReplaceGo" style="cursor:hand;" />

And an onclick call from jquery:

$(document).ready(function() {
        $('#allReplaceGo').click(replaceAll);
});
function replaceAll(){ alert('a'); }

When I click the button, nothing happens. When I instead use onclick=”replaceAll()” within the HTML, I get an error: Uncaught ReferenceError: replaceAll is not defined

I am unable to figure out a connection between these errors, or any possible cause.

The code is currently live at http://www.texturepacker.net

Edit: Looks like I get two different results in Firefox and Chrome, Chrome does nothing while Firefox alert(‘a’)’s once the page loads. Now I’m just plain confused?

Edit: Seemingly an unrelated syntax error later in my code was breaking the call. Now replaceAll() is called when the dom loads, my question is now why isn’t replaceAll() being launched onclick and instead once the dom loads, am I missing something obvious?

  • 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-12T01:01:10+00:00Added an answer on June 12, 2026 at 1:01 am

    Look like a syntax error here…

    Line 196 in you script file says

    $(this).("src",tmpSrc);
    

    It is supposed to be

    $(this).attr("src",tmpSrc);
    

    Fix that and it should be all fine..

    Also on line 7

    $('#allReplaceGo').live("click",replaceAll());
    

    is supposed to be

    $('#allReplaceGo').live("click",replaceAll);
    

    Also as of version 1.7 .live() is deprecated. try using .on() instead

    • 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: index.jsp: <form name=f action=db/ajoutConducteur.jsp method=post> <input type=text pattern=\d{8} required
I have input text: <div><label wicket:for=name>Name</label><input type=text wicket:id=name /></div> Now I need to add
I have: <?php $goto = $_GET['goto']; ?> and: <form method=get><input type=text name=goto id=goTo /></form>
I have such code: function allValid() { $('input').each(function(index) { if(something) { return false; }
I am trying to have two input boxes, and a button which will update
I have a ajax function in index.php which calls on the page thread.php which
I have a form on one page, and the submit button on that page
I have created a page index.php with a lot of divs and I need
I need to check if button in jsp page is clicked. I have 1
The JS/Ajax function I have built submits without a button click or page refresh.

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.