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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T23:12:38+00:00 2026-06-13T23:12:38+00:00

I am having an issue with ZEND, JQuery, PHP, and Javascript. I am very

  • 0

I am having an issue with ZEND, JQuery, PHP, and Javascript. I am very new to these languages, and I am just trying to work my way around them.

I have had jquery.post work in other cases, but I cannot get it to do a simple call right now.

phtml File (/admin/user.phtml)

function testJquery()
{
var url = "<?php echo $myHome2Url.'/admin/newusercallback/sessionid/'.$_SESSION['mySessionId'].'/lang/'.$_SESSION['language']?>";
console.log(url);
$.post(url,{},
function(data)
{
    window.alert("Call successful!");
    window.alert(data);
},"json");

}

PHP File: (AdminController.php)

public function newusercallbackAction()
{
     echo json_encode("Test");
}

A /admin/newusercallback.phtml file exists.

  <?php ?>

When run, the console has the following messages printed to it:

POST https://dev.myurl.ca/admin/newusercallback/sessionid/0c1a5e41-ad0a-470d-9901-305464b48908/lang/ENG
https://dev.myurl.ca/admin/newusercallback/sessionid/0c1a5e41-ad0a-470d-9901-305464b48908/lang/ENG
GET https://dev.myurl.ca/admin/user/sessionid/0c1a5e41-ad0a-470d-9901-305464b48908/lang/ENG/report_id/0/

I have 2 popup boxes appearing, which say Call Successful! and Null

The issue is that the second popup box should say “Test” instead of Null.

If I browse to the URL https://dev.myurl.ca/admin/newusercallback/sessionid/0c1a5e41-ad0a-470d-9901-305464b48908/lang/ENG directly, my browser displays a window with the text

"Test"

(quotation marks inclusive)

My question is, why is the callback data for testJquery Null, when browing directly to the page is displaying the data “Test” correctly?
Further to that, how can I fix it!

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

    Thats becouse your jQuery function asking for “json” format, and text “Test” is not json.

    Solutions:
    1. Remove “json” dataType on your testJquery() function:

        function testJquery(){
            $.post(url,{},function(data){
                window.alert("Call successful!");
                window.alert(data);
            });
        }
    

    2. Edit your AdminController.php file to encode array object

        public function newusercallbackAction(){
            echo json_encode(array("Test"));
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm having an issue trying to append a javascript file using headScript()->appendFile('file name') with
I am just having issue with jquery maphilight when printing everything works fine and
i am having issue with loading my selector via a jquery ajax load call
Just started mongo and started having issue with querying already. i have a collection
Having an issue with random individuals trying to access an intranet site with a
Having an issue with traversing in jQuery.. hopfully an easy one..but I'm banging my
I am having an incredibly difficult time to decorate a Zend form the way
I am having this issue with Zend and Doctrine and I am hoping someone
I am having an issue with zend database table library; Sorry, I got fixed
We're trying to use Redmine as our issue tracker. I use Zend Studio 8.0.0

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.