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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T23:12:41+00:00 2026-06-08T23:12:41+00:00

My web app (running jQuery) gets the following JSON response from the server: {

  • 0

My web app (running jQuery) gets the following JSON response from the server:

{
    "script_0": "$('#objview_0_306').on('click', function(e){ getObjectResponse(96089, '306', 'display'); e.preventDefault();});",    
    "verb_0": "display",
    "obid_0": "0_306",
    "body_0": "<div id=\"objview_0_306\"></div>",
    "icon_0": "icons/caseman16.png",
    "close_0": "previousTab();",
    "title_0": "Cases",
    "cmdCount": "1"
}

The script_0 element contains scripts that must be run, in this case adding an onClick event to a DOM element.

At the moment, I use eval() to run the scripts, since they are returned as strings. Is there a way to avoid using eval()?

  • 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-08T23:12:43+00:00Added an answer on June 8, 2026 at 11:12 pm

    Noop. The eval (and alias Function constructor etc.) is designed to do exactly this, parse strings into runnable javascript.

    If you don’t want to use eval, instead of return the complete javascript from the server, you can return values in json response that instruct your client app to do predefined tasks.

    I’m going to plagiarize the comment made by @Esailija:
    Why on earth would you have code in json? it’s a data-interchange format…

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

Sidebar

Related Questions

We have a web application (JQuery and Spring) running on weblogic app server. There
I have a PHP app running happily on the following system: web app: PHP
i'm creating a web app that's running on an Advantage Database server, not my
I'm running a web app in Jboss application server and I'm trying to implement
I'm using jQuery 1.7.1 in a web app running on WebLogic 10.3.2. I do
I have an web app running on lets say following IP : 10.101.10.101 .
I am running a query from my java based web app running in a
Need to execute an external EXE from either a Java web app (running on
I get the following error message when trying to connect a web app running
I have a Java web app running on Tomcat 7 that is using JDBC

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.