Log in

View Full Version : Using this code in a template - Any ideas how?


Sweeks
05-17-2009, 08:10 PM
I am wanting to use this code but cant and I am not sure why it isnt working within the templates, the install instructions ask me to please this after calling the script between the <head></head> tags but when I do it displays this on the browser when it shouldnt. It is part of a Jquery script:

jQuery(document).ready(function($) {
$('a[rel*=facebox]').facebox()
})

Hope someone can help, I think it may be to do with the $ sign.

Thank you.
________
Persian Cooking (http://www.cooking-chef.com/persian/)

Lynne
05-17-2009, 08:20 PM
You should ask for help at the place you got the install instructions.

RLShare
05-17-2009, 08:28 PM
Are you putting the code inside of 'script' tags?

Sweeks
05-17-2009, 08:28 PM
I doubt I will get any help as theyre just Jquery coders and probably dont use vbulletin, the script works fine outside of vbulletin that's why I asked for some help on here if anyone knows how to get it to work.

RLshare:

I have put the code outside of the script tags yes, is this incorerect? If so, Is it meant to be within the script tags?
________
Georgian recipes (http://www.cooking-chef.com/georgian/)

RLShare
05-17-2009, 08:31 PM
Anytime you put client side script in a page, it needs to be within script tags to tell the browser that it is a script to be executed and not content to be displayed.. with the exception of actually putting the script in the markup
<script type="text/javascript">
//Your code
</script>

Sweeks
05-17-2009, 10:59 PM
Thank you, I havent had much experience with jquery or JS but you learn something new every day, thanks for this RLShare, it works perfectly :)
________
MAGIC FLIGHT (http://mflbvaporizer.com)