Javascript + Widget = busted OpenURL string. noob hopefully

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
imstupid
Forum Commoner
Posts: 84
Joined: Fri Feb 18, 2005 1:24 pm

Javascript + Widget = busted OpenURL string. noob hopefully

Post by imstupid »

feyd | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]


Thank god I found this site again. Hello everybody - long time. So, I moved off php for a while, and got back into the design side of things. Needless to say, I forgot a lot of things, and here we are today.

So I'm making this Widget for Mac OSX and I'm having trouble with 1 line of Javascript code. I'm trying to generate a link name using the getdate() var thing I don't really know much about. 

What's weird is it works for the img src= part of it, just not the OpenURLpart. I think I'm missing some curly brackets or back ticks or the use of a magic wand, who knows. Here's some code:

Broken:
[syntax="javascript"]document.getElementById("recipes").innerHTML= "<img id='recipelink' onclick='widget.openURL(\"http://www.example.com/\" + todaym + todayd + \".htm\");' src='nrs/" + todaym + todayd + ".png'>";
the .pngs show up great, just the link isn't working. hand cursor shows up, but is unclickable.

oh, and by the way, if I manually type in the html file name, it works fine:

Code: Select all

document.getElementById("recipes").innerHTML= "<img id='recipelink' onclick='widget.openURL(\"http://www.example.com/1019.htm\");' src='nrs/" + todaym + todayd + ".png'>";
Thats it. Thanks for the time. What else has been going on the past 8 months or so?


feyd | Please use[/syntax]

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
User avatar
hawleyjr
BeerMod
Posts: 2170
Joined: Tue Jan 13, 2004 4:58 pm
Location: Jax FL & Spokane WA USA

Post by hawleyjr »

There is a chance the todaym + todayd are being added and not parsed. Throw an empty string between them and see what happens.
imstupid
Forum Commoner
Posts: 84
Joined: Fri Feb 18, 2005 1:24 pm

Post by imstupid »

hey thanks for the response. I tried doing the empty string and no luck. Same scenario with the hand cursor, but no action. Thanks again for any help. It's driving me nutso.
Post Reply