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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T17:21:05+00:00 2026-05-30T17:21:05+00:00

This handler doesn’t like the $page parameter in the eval function, getting error missing

  • 0

This handler doesn’t like the $page parameter in the eval function, getting error “missing ] after element list” is there anyway to pass this parameter through?

$('div[data-role="page"]').live('pageinit pagebeforeshow pageshow pagebeforehide pagehide', function (event, ui) {
    var $page = $(this);
    var type = event.type.replace('page', 'Page').replace('init', 'Init').replace('before', 'Before').replace('show', 'Show').replace('hide', 'Hide');
    eval('Controller.Method.' + type + '(' + $page + ')');
});
  • 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-30T17:21:07+00:00Added an answer on May 30, 2026 at 5:21 pm

    You’re forcing $page to be part of a string, which doesn’t quite work because it’s a jQuery object. The string will be [object Object] because there is no better string representation for a jQuery object.

    This is exactly a case in which to avoid using eval. This should work, and is cleaner and safer:

    Controller.Method[type]($page);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm getting a JSON element and building a list from its items like this:
I'm getting this error: Uncaught handler: thread main exiting due to uncaught exception java.lang.VerifyError
I have a protocol in Objective-C, something like this: @protocol Handler +(NSString*) getValue; @end
I am using this code snippet to add KeyDown event handler to any element
Evil or not evil? public static void Raise(this EventHandler handler, object sender, EventArgs args)
I somehow have the feeling that modern systems, including runtime libraries, this exception handler
From this answer: When is a C++ terminate handler the Right Thing(TM)? It would
Basically this is a question how to access local scope handler. I trying to
I come across this problem when i am writing an event handler in SharePoint.
I've seen this done inside of an event handler directly behind the .xaml file

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.