lucaong / jQCloud

jQuery plugin for drawing neat word clouds that actually look like clouds
MIT License
646 stars 293 forks source link

Javascript as URL #4

Closed kishanr closed 13 years ago

kishanr commented 13 years ago

How can I put a javascript in the url? Sth like: url: "javascript:openFunction('test')"

lucaong commented 13 years ago

you can safely put javascript in the URL, just make sure to use double quotes (because the link's href attribute gets enclosed in single quotes).

e.g.:

  var word_list = [
    {text: "Lorem", weight: 13, url: 'javascript:alert("hey!")'},
    // other words...
  ]