Monday, July 1, 2013

RE: Cake or IE9?

Yes just localhost so no worries there.

 

I managed to figure it out with just trial and error.

Seems IE did not like my JSON response for some reason. So changing my _ajaxResponse to use:


return new CakeResponse(array('body' => json_encode($response), 'type' => 'json'));

 

This is an old site I am updating so I guess there are a few glitches like that I will run into along the way.

 

Thanks again for you time and thought's.

 

Dave

 

From: cake-php@googlegroups.com [mailto:cake-php@googlegroups.com] On Behalf Of Reuben
Sent: Monday, July 01, 2013 4:17 AM
To: cake-php@googlegroups.com
Subject: Re: Cake or IE9?

 

The next thing I would try is enabling debugging with the Ajax call, and see what error you get back from the server.  

 

Hopefully, this is a scenario you are reproducing in a development environment.  Any useful errors are probably being blocked by debug=0 in the  _ajaxSetup() call.

 

While you're in the development environment, definitely make sure that the is('ajax') portion of the code is actually getting executed, with a few well placed CakeLog::debug() calls.

On Monday, 1 July 2013 10:47:51 UTC+10, advantage+ wrote:

Will play around even more.

 

Using newest version of jQuery.

The ajax response / headers are set in the $this->_ajaxReturn($response); and it works fine in every other browser. It returns a JSON encoded response.

My current code even works in IE8, its just 9 that does not want to co-operate with me.

 

I will try .on() and see how that goes.

 

In the js snip :

 

$("a.portfolio").click(function(e){

                                e.preventDefault();

                                var link = $(this).attr("href");

 

                                $.ajax({

                                                type: "GET",

                                                url: link,

                                                //cache: false,

                                                dataType: "json",                                            

                                                success: function(response) {

                                                               

                                                                alert(response);

                                                ……………………

 

 

There is never a response from the server in IE9 it never comes back with anything. Just sits there waiting for something I suppose.

 

Thanks for your time. See how it goes J

 

From: cake...@googlegroups.com [mailto:cake...@googlegroups.com] On Behalf Of Reuben
Sent: Sunday, June 30, 2013 8:28 PM
To: cake...@googlegroups.com
Subject: Re: Cake or IE9?

 

Here are the things I would be looking at first.

 

1. Consider the version of jQuery you are using.  In newer releases of jQuery, .live() is deprecated, or just doesn't work.  If this is working for you, then you may be using an older version of jQuery, and that may have issues with IE9. The newer way is to use .on() for event handling, but if you go too new, then IE8 gets knocked off the list of supported browsers.

 

2. You shouldn't need to use Firebug Lite to inspect the DOM, JS and Network in IE9.  Typically, I use Chrome, but the inspectors in IE9 are pretty good.  Having said that, if a response isn't getting sent, that might be a server side issue, but likely because your Ajax request isn't invoking an Ajax response.  You may want to compare Request-Type, Application-Type, Content-Type or X-Requested-with, or whatever it is that indicates to CakePHP that an Ajax request is coming in, and an Ajax response is required.

 

3. If you can see that a response is being sent from the server, then you're probably looking at a JS/IE9 issue.

On Monday, 1 July 2013 06:41:08 UTC+10, advantage+ wrote:

The request is being sent / response via regular ajax view. It works in all browsers using this approach except IE9.

I check Firebug Lite in IE and the same request gets sent but it never returns anything it just sits there with the little spinner in FB lite.

So that’s why I am wondering if it’s a cake / ie9 issue or just an issue with my JS script.

 

       /************************************************************

       * VIEW METHOD

       * ***********************************************************

       *

       *

       *

       *

       ************************************************************/

       public function view($slug = null) {

             

              $portfolio = $this->Portfolio->getPortfolioBySlug($slug);

             

              $this->set('portfolio', $portfolio);

              $this->set('neighbors', $this->Portfolio->getNeighbors($portfolio['Portfolio']['order']));

             

              if ($this->request->is('ajax')) {

                     $this->_ajaxSetup(); //prepare for ajax request no render, set debug 0

                     $response = array(

                     'html' => $this->render('view', 'ajax')->body(),

                     'slide' => $portfolio['Thumb']['0']['slide']);

                     $this->_ajaxReturn($response); //returns the json array / response

              }

             

       }

 

From: cake...@googlegroups.com [mailto:cake...@googlegroups.com] On Behalf Of AD7six
Sent: Sunday, June 30, 2013 9:10 AM
To: cake...@googlegroups.com
Subject: Re: Cake or IE9?

 



On Sunday, 30 June 2013 05:41:36 UTC+2, advantage+ wrote:

Not sure if this is a Cake issue or just stupid IE.

 

I have a small snip of js code that works in all browsers except IE9.

 

There's no CakePHP in your question.

 

AD

--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP
 
---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+u...@googlegroups.com.
To post to this group, send email to cake...@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP
 
---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+u...@googlegroups.com.
To post to this group, send email to cake...@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP
 
---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

No comments: