简体   繁体   中英

Javascript Conflict in Wordpress

I'm trying to load an Aweber form via Javascript inside of a right sidebar widget. The form loads, although it appears differently than the way I designed it in Aweber. I'm 90% sure that it's a Javascript conflict because I loaded the Aweber form in the section with wp_enque_script, and the form looked correct (but I don't want the form to actually appear in the head section itself. The website can be found here: http://www.richmindonline.com/yourunlimitedself .

Obviously, the Aweber script is a direct call for action to grab the web form, so I cannot load it in the or it shows up at the top of my page. So is there a way to load my form in the correct place on the page while still using wp_enque_script to resolve my conflict?

Here's the code for the Aweber form (formatted wrong to fool the text editor). This code is currently found in a "text widget" in the right sidebar:

 <script type="text/javascript" src="http://forms.aweber.com/form/74/1378551674.js">
</script>

The actual head section with relevant code is shown below. I don't have any idea as to what I should do here.

 <?php wp_enqueue_script('jquery'); ?>     
<?php wp_head(); ?>

Also, here is the relevant section of code that is currently un-altered for what I need.

<script src="<?php bloginfo('template_directory'); ?>/js/jquery-1.3.2.min.js" type="text/javascript"></script>
<script src="<?php bloginfo('template_directory'); ?>/js/jquery.jcarousel.pack.js" type="text/javascript"></script>
<script src="<?php bloginfo('template_directory'); ?>/js/jquery.easing.1.3.js" type="text/javascript"></script>
<script src="<?php bloginfo('template_directory'); ?>/js/jquery.colorbox-min.js" type="text/javascript"></script>
<script src="<?php bloginfo('template_directory'); ?>/js/functions.js" type="text/javascript"></script>

It'd be difficult to say where it conflicts without seeing errors and line numbers, etc.

This isn't an exact answer to your question, but a potential workaround with the information you provided. Aweber should give you the option to copy and paste the HTML of the form into your widget instead of the javscript code.

The advantage to this is you can edit the HTML to look exactly like you want. The disadvantage is that you would have to go to your website everytime you wanted to update the form as opposed to being able to update it in Aweber.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM