include an absolute path that is relative to the app's path. For
example:
$.getJSON("/path/myson.json", function(json) {
// code here
});
What if the app is installed in a subdirectory? Then I'd have to put "/
subdir/path/myson.json". How do I keep the code flexible without
having to change it for each install?
From the comments of your jquery.mi.js file it looks like it does what
I'm talking about. I'm not very experienced and I'm a little fuzzy on
how to implement that code.
On May 1, 6:59 am, AD7six <andydawso...@gmail.com> wrote:
> On May 1, 1:49 pm, fly2279 <kennethf...@gmail.com> wrote:
>
> > Has anyone done something like declaring cake's constants in a
> > javascript file for use in all javascript files created for the app? I
> > keep wondering what approach I should take for things like a path that
> > might change depending on where the app is installed. Should I just
> > set a variable to APP and serve the javascript file blended with php
> > so that I can access it in other included javascript files? How does
> > everyone else do it?
>
> I'm not really clear on what you mean - but I include this js file (js
> files which cake serves - i.e. not directly in the webroot - can
> include php logic)http://github.com/AD7six/mi_js/blob/master/jquery.mi.js
> which allows your js code to know if it's running in a subfolder
>
> if that doesn't help a description of what you're trying to do would
> likely get you help.
>
> hth,
>
> AD
>
>
>
> > Check out the new CakePHP Questions sitehttp://cakeqs.organdhelp others with their CakePHP related questions.
>
> > You received this message because you are subscribed to the Google Groups "CakePHP" group.
> > To post to this group, send email to cake-php@googlegroups.com
> > To unsubscribe from this group, send email to
> > cake-php+unsubscribe@googlegroups.com For more options, visit this group athttp://groups.google.com/group/cake-php?hl=en
>
> Check out the new CakePHP Questions sitehttp://cakeqs.organd help others with their CakePHP related questions.
>
> You received this message because you are subscribed to the Google Groups "CakePHP" group.
> To post to this group, send email to cake-php@googlegroups.com
> To unsubscribe from this group, send email to
> cake-php+unsubscribe@googlegroups.com For more options, visit this group athttp://groups.google.com/group/cake-php?hl=en
Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions.
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
No comments:
Post a Comment