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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T10:49:20+00:00 2026-05-25T10:49:20+00:00

In my CakePHP view, I call method in controller, using jQuery: function placeSensors(nk) {

  • 0

In my CakePHP view, I call method in controller, using jQuery:

function placeSensors(nk) {
  $.ajax({
    type:'post', 
    url:'/myapp/maps/placeSensors/' + nk, 
    success: function(r) {
      if(r.status = 'ok') {
      }
    }
  });
}

JS in controller is defined with ie.:

class MapsController extends AppController {
  var $name = 'Maps';
  var $helpers = array('Js');
  var $uses = array('Measurings', 'Maps');
  var $components = array('RequestHandler'); // added later, but still the same


function index( $id = null, $value = null ) {
$code = '';
?>
<script type="text/javascript">
  alert('Hello!');
</script>
<?php
return $code;
}

So, with simple code, I can not get alert message on my web form. Very simple code I was using in some other project and it works there, and for some reason this does not work on this one…

I’m really stuck with this one, can you please help me…..

UPDATE: this is response i’m getting by Firebug:

<script type="text/javascript">
  alert('Hello!');
</script>
  • 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-25T10:49:21+00:00Added an answer on May 25, 2026 at 10:49 am

    Ok, i finally solved this one.

    All I needed was to add one form and one text, or even better hidden element on form.

    After that everything started to work.

    So my mentioned code was ok, all I needed was that one text box……… Hope that somebody can tell me why?

    Thank you on all your help and support.

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

Sidebar

Related Questions

I can't seem to find a method to call different controller in the same
I have the CakePHP stack in /var/www/site from one view under controller A I
I am using Cakephp but this is a MVC/php doubt letting the view display
I am using jQuery-1.4.2 with CakePHP and a few days ago I had this
I've got a small question about Creating Aro-s in Cakephp http://book.cakephp.org/#!/view/1547/Acts-As-a-Requester I'm using code
In a CakePHP 1.2 app, I'm using <?php $session->flash();?> to output messages like Record
I'm using the cacheCounter in CakePHP , which increments a counter for related fields.
What's the cleanest way to add a prefix to every URL in CakePHP, like
I'm trying to upload a file with cakePHP. This is the view: echo $form->create(null,
I'm trying to create an XML sitemap using CakePHP, from a table which has

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.