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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T09:51:40+00:00 2026-05-25T09:51:40+00:00

I have a page on which I am ajax-ing in a table which has

  • 0

I have a page on which I am “ajax-ing in” a table which has a radio button with the same name on each row. Each row is dynamically generated via a JSTL foreach, but for simplicity I removed it here. Basically, the following is injected on another page via ajax, ohh…I am using jquery 1.8

 <script type="text/javascript">
 $(document).ready(function(){
        if (!$("input[@name='student']:checked").val()) {
            alert('Nothing is checked!');
            return false;
        }
        else {
            alert('One of the radio buttons is checked!');
        }       
 });           
</script>
<table id="studentTable" border="1" style="width: 100%;">
      <tr><th>Select</th></tr>  
      <tr><td><input type="radio" name="student" value="${s.id}"/></td></tr>
</table>

So after the ajax call, using firebug, my script is there in the page along with all of the other table stuff. The thing is the javascript that came accorss via ajax seems to be inactive. I saw some people suggested to use the “eval” function.

Can someone please offer some guidance in this regard, thank you.

EDIT

This is the script I am using to inject the above in my page.

      function search() {
          var resultNode = dojo.byId("results");
          dojo.xhrPost({
              url: "${searchstudentsurl}",
              form: dojo.byId("searchform"),
              load: function(newContent) {
                  dojo.style(resultNode,"display","block");
                  resultNode.innerHTML = newContent;
              },
              error: function() {
                  resultNode.innerHTML = "Your student search form could not be sent";
              }
          });
}

Now dojo has the “handleAs” option, but if i specify the option handleAs: “html”, the post simply fails because of this line. I am no sure how to use the dojo eval function. Please Help, thank you.

  • 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-25T09:51:41+00:00Added an answer on May 25, 2026 at 9:51 am

    Documet ready event is triggered only for the main page load, not AJAX calls. Design Javascript logic so that it lies outside HTML and is loaded in a .js file with the main page.

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

Sidebar

Related Questions

I have a drop down list which is dynamically generated using ajax on page
I Have a page which has comments left by users, each post has has
I have page which created dynamically. Now I want to add ajax function, so
I have a page which dynamically loads a section of content via AJAX. I'm
I have a page which dynamically brings in a form via ajax and displays
I have a page which dynamically creates multiple forms, each form had a unique
Scenario: I have a login page which uses ajax to validate a user and
I have a search page which uses a simple ajax request to get new
Situation: I have an index page which loads pages into it with ajax as
I have a web page on which i am applying Ajax enabled update progress

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.