Jump to content

Archived

This topic is now archived and is closed to further replies.

Mark & Phil

Text Box Kills Javascript

Recommended Posts

Mark & Phil

What is the proper way to insert Javascript into a pagelines dms site? We're attempting to do it through the Text box section but we've tried two completely different javascript maps now and none of them work inside the text box but DO work inside the post loop section. unfortunately we can't use the post loop section on a homepage like we would need to.  You can see what I mean if you take a look at http://iwhc.wpengine.com and scroll down to the map part.

 

Thanks!

 

Share this post


Link to post
Share on other sites
Andrew

Why do you need inline javascript? 

 

these days its almost ALWAYS bad practice to do JS inline, I would only use it if i absolutely needed to make a page loading experience slightly better or something.

Share this post


Link to post
Share on other sites
Mark & Phil

OK, fine, but is it best practice to call the JS from a textbox? We'd still have to call the JS function that references the external JS file. We wouldn't want it loading on every page, just for that text box.

Share this post


Link to post
Share on other sites
Mark & Phil

And in the example I was mentioning, we ARE referencing it in the header and executing the function in the Textbox Section. 

 

So, to recap, we just want to know whats the best way to reference the JS functions we need. We think it seems to be adding that function to a Textbox Section but if there is something more appropriate please let us know.

 

Thanks so much!

Share this post


Link to post
Share on other sites

×