Loading in Jquery

136 views
Skip to first unread message

vincent warmerdam

unread,
Feb 4, 2014, 4:06:26 AM2/4/14
to mraid-we...@googlegroups.com
Hi all, 

I would like to add Jquery to my ad and test it with your webtester. Small question; how can I get the script tag to load in Jquery? When I add;

<script src="mraid.js></script> 
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
<script> ... all the js that loads the ad ... </script> 

It gives me a ReferenceError: Can't find variable: $, but if I just blunty put all jquery code into the <script> it does work. Is there a site setting that disallows the use of a CDN? 


Nathan Carver

unread,
Feb 4, 2014, 12:33:49 PM2/4/14
to mraid-we...@googlegroups.com
Hi Vincent,

No there isn't a setting that prevents CDN or any domain path, but there may be some peculiarity in the scripting execution.

Do you already have code to wait until jquery is loaded?

Thanks,
-Nathan



--
You received this message because you are subscribed to the Google Groups "MRAID Web Tester" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mraid-web-test...@googlegroups.com.
To post to this group, send email to mraid-we...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mraid-web-tester/5d4b52d1-2ee2-4f24-b04e-7a4d401fb494%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Frank Shepard

unread,
Feb 4, 2014, 1:14:47 PM2/4/14
to mraid-we...@googlegroups.com
Vincent & Nathan,

It looks like script tags with src attributes are breaking in the ad loader. If there is more than one, the first will be ok, but the second will not be added to the DOM correctly. To test, try placing your jquery library reference first.

Best,
Frank


Frank Shepard

unread,
Feb 18, 2014, 9:58:30 AM2/18/14
to mraid-we...@googlegroups.com
Vincent -- I didn't notice before, but there is a syntax error in your code. You need to close the src attribute in your first script tag -- right now it reads src="mraid.js>; it should be src="mraid.js">. This is likely the cause of the problem.

Best,
Frank
Reply all
Reply to author
Forward
0 new messages