rbrenton / jmpopups

Migrated from code.google.com/p/jmpopups
0 stars 0 forks source link

Use of 'cache' option in ajax call can interfere with frameworks that use URL routing #3

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Thank you for a great jQuery plugin.

I have started using this in my favorite PHP MVC framework, CodeIgniter.

It took me a few hours to figure out that the use of the 'cache option' in
the ajax call (line 279 of jmpopup v0.5.1) places a parameter at the end of
GET URL request (if the example ajax url is 'ajaxurl.html', the actual
request sent with cache option enabled will be something like
'ajaxurl.html?_=1248414935117".  The additional parameters causes
'confusion' to frameworks which use URL routing, such as CodeIgniter (and
likely other frameworks).

Simply commenting out line 279 solves the problem.

Do you feel that caching is absolutely necessary as a default setting??

Perhaps you could disable this as the default option, or make a comment in
the wiki?

What is the expected output? What do you see instead?
  Expected - load ajax file
  Acutal - error 404

What version of the product are you using?
0.5.1

Original issue reported on code.google.com by mark%cod...@gtempaccount.com on 24 Jul 2009 at 5:58

GoogleCodeExporter commented 9 years ago
Hello.

There is a option called "cache". With this option you can choose if you want to
cache the content or not.

To solve your problem, only add this as true. For example:

$.openPopupLayer({
    name: "mySecondPopup",
    width: 300,
    url: "ajax_example.html",
        cache: true
});

PS.: this "weird" number in the url is created by jquery when the cache option 
is false.

Many thanks for your feedback!

Cya!

Original comment by otavioavila@gmail.com on 27 Jul 2009 at 9:49