Page 1 of 1

Setting the Panel's HTML property from a javascript routine

Posted: Sun Apr 07, 2013 3:56 pm
by Andy Parker

Hi, I need to set the HTML property of a panel with javascript as I create a URL on the fly.

An example would be (where var fullurl is something like http://google.com):

var iframeurl = '';

I then want to set the HTML property of the panel component to the variable 'iframeurl' so it will effectively bring up the appropriate site in the panel.

I've tried everything from storing the iframeurl string in a text field, then simply setting a local variable to the text field, then setting the Panel HTML to the local variable (outside of javascript)- but it still doesn't work.

What am I doing wrong?


Setting the Panel's HTML property from a javascript routine

Posted: Sun Apr 07, 2013 3:59 pm
by Andy Parker

oddly the var iframeurl = " was deleted.

let me try again.

var iframeurl = ""';

Ive changed the single quotes at the start and end for doubles to try to get the line to post


Setting the Panel's HTML property from a javascript routine

Posted: Sun Apr 07, 2013 4:00 pm
by Andy Parker

last go:

var iframeurl = '_';


Setting the Panel's HTML property from a javascript routine

Posted: Sun Apr 07, 2013 4:01 pm
by Andy Parker

Im having trouble getting the url to display on this forum:

var iframeurl = 'iframe src="' + fullurl + '" width="200px" height="600px"/';

there are < around the line but I had to delete them to get them to display on this forum.


Setting the Panel's HTML property from a javascript routine

Posted: Sun Apr 07, 2013 5:06 pm
by maxkatz

When you do a full reply (vs a comment), there is a link "some HTML allowed". It will show you how to add a code to your post.

When you tried your solutions, did you check with Chrome Dev. Tools that you are getting the correct URL?


Setting the Panel's HTML property from a javascript routine

Posted: Sun Apr 07, 2013 5:13 pm
by Andy Parker

thanks for the tip with the code post.

I've sorted this now, it appeared to be an oddity with passing the URL text to multiple vars and building it piece by piece.

I reduce the steps to 1 build statement and it works :-)

Very happy, thanks again for the tip.

regards

Andy