Where did you put the makethumbs.js? What is the path?
<script type=”text/javascript” src=”<?php bloginfo(url);?>/path from website root/makethumbs.js”></script>
As i said in the post the js file is in the same folder as the Header and template files etc ( root of the twentyeleven theme )..
In that case, the correct code is:
<script type=”text/javascript” src=”<?php bloginfo(template_directory);?>/makethumbs.js”></script>
That’s not making any difference, thanks though. If there’s no path it’d just reference the same folder it’s running out of tho right?
Any idea why the text in my replies on here are showing up in mixed fonts??
Because you keep using backticks instead of single quotation marks. Backticks are used by the forum’s parser to indicate code blocks.
U on about something in the code whats a back tick?
A single quotation mark looks like this -> ‘. You are using a grave accent.
Ahh the punctuation in my text?? So if i wrote it’s i have to use the straight one rather than the backwards tilted one.. why doesn`t the code button wrap it in a proprietary code tag like normal forums?
So if i wrote it’s i have to use the straight one rather than the backwards tilted one
Correct.
why doesn`t the code button wrap it in a proprietary code tag like normal forums?
The backtick is classed as a proprietary code tag here.
It’s quite a pointless one then isn’t it, if it conflicts with standard text / can’t differentiate.
Chome is now showing ‘Uncaught Reference Error: makethumbs is not defined’ on the debug. It`s being thrown at the following code in the template page:
<script type="text/javascript">
<!--
makethumbs();
Uncaught ReferenceError: makethumbs is not defined
//-->
</script>
It doesn`t seem to be complaining about can’t find the script now so no idea..
[No bumping. If it’s that urgent, consider hiring someone.]
Okay i got this working, it was basically an url/location as Flashbuddy pointed out. Notice the kindof curly speechmarks in your code Flashbuddy? That’s what was throwing it and i hadn’t noticed..
I have a fresh new problem – in my external js file i’m trying to use the template url in javascript using the php command:
var backgroundUrl = "<?php bloginfo(template_directory);?>" + "/images/thumbs/" + numThumbs + ".jpg";
alert(backgroundUrl);
newdiv.style.backgroundImage ="url("+backgroundUrl+")";
But the php code doesn’t seem to be giving the url, it’s just printing the php code..
Any hints/tips?