0

i have just figured this out http://jsfiddle.net/bUjx7/105/

but when i copy the code into dreamweaver it does not work!

I never use jquery so how do you add the library as i know it's done automatically in jsfiddle? Is it with a link in the head tag? I tried adding

<head>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js">
</head>

but this doesnt work is it something to do with the onLoad?

I really don't know, I know this is a simple problem but hopefully once i know, i wont ever have to ask again

Ned
  • 246
  • 2
  • 3
  • 13

1 Answers1

1

The default value of the second dropdown in jsFiddle is "onLoad". This means any javascript you write in the script panel will be executed in an onLoad event handler. Since you're using jQuery, you can reproduce this behavior by using a $(document).ready block*:

$(document).ready(function () {
    // your code from the jsFiddle javascript panel
});

*onLoad and document ready are not the same thing, but either will work for you.

Community
  • 1
  • 1
jbabey
  • 45,965
  • 12
  • 71
  • 94
  • It still isn't working?? I don't know what i'm doing wrong? I have wrapped the jquery with your code and put – Ned Jun 24 '13 at 15:02
  • Thanks for that code it worked, the only reason it didnt was because i didnt put http: in that link! oops – Ned Jun 24 '13 at 15:15
  • @Ned glad i could help. cheerio – jbabey Jun 24 '13 at 15:20