page3.html is my scenario (in Peter's example). To clarify, page3.html has some unique data that would get passed to my external JS function. Once the external JS is minified, the names change. That being said, how can I refer to the renamed function?
Is there a more efficient way of passing this required param to my external JS? Ex: page.htm calls the following function, passing page specific data: js.myJS.doAJAX(pageSpecificParameter); On Mar 15, 12:53 pm, Peter Higgins <[email protected]> wrote: > I think he wants the function to be aware of the page it was included > from. Eg: > > page1.html > var infos = { url:"bar.php" } > <script src=thing.js> > > page2.html > var infos = { url:"baz.php" } > <script src=thing.js> > > thing.js > window.onload = function(){ > ajaxftw({ > // not really a "global config object". > url: infos.url > }) > } > > It would probably make more sense to make thing.js just be a function, > and call the function from the pageN.html > > page3.html > <script src=thing.js> > <script>window.onload = function(){ ajaxftw{ { url:"bar.php" } ) }</script> > > Or however. Or perhaps I missed the question too. > > ~phiggins > > On 3/15/11 12:44 PM, Michael Geary wrote: > > > Minifying a .js file shouldn't affect how you call functions in that > > file. Simply call them as you normally would. > > > In your case, I think you'd want to embed a function call with the > > required parameter in the generated source for each page. > > > Or did I miss something? If so, explain in more detail... > > > -Mike > > > On Tue, Mar 15, 2011 at 9:30 AM, Wilkins <[email protected] > > <mailto:[email protected]>> wrote: > > > I have an AJAX function located in an external JS file that needs to > > be called per page to load specific data. Each page has a value that > > needs to be passed into this function. When my files get minified, how > > can I call that same function on each page? > > Should I be taking a different approach to this? > > > -- > > To view archived discussions from the original JSMentors Mailman > > list: http://www.mail-archive.com/[email protected]/ > > > To search via a non-Google archive, visit here: > > http://www.mail-archive.com/[email protected]/ > > > To unsubscribe from this group, send email to > > [email protected] > > <mailto:jsmentors%[email protected]> > > > -- > > To view archived discussions from the original JSMentors Mailman list: > > http://www.mail-archive.com/[email protected]/ > > > To search via a non-Google archive, visit here: > >http://www.mail-archive.com/[email protected]/ > > > To unsubscribe from this group, send email to > > [email protected] > > -- To view archived discussions from the original JSMentors Mailman list: http://www.mail-archive.com/[email protected]/ To search via a non-Google archive, visit here: http://www.mail-archive.com/[email protected]/ To unsubscribe from this group, send email to [email protected]
