Andy Parker
Posts: 0
Joined: Wed Mar 27, 2013 10:21 am

Setting the Panel's HTML property from a javascript routine

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?

Andy Parker
Posts: 0
Joined: Wed Mar 27, 2013 10:21 am

Setting the Panel's HTML property from a javascript routine

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

Andy Parker
Posts: 0
Joined: Wed Mar 27, 2013 10:21 am

Setting the Panel's HTML property from a javascript routine

last go:

var iframeurl = '_';

Andy Parker
Posts: 0
Joined: Wed Mar 27, 2013 10:21 am

Setting the Panel's HTML property from a javascript routine

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.

maxkatz
Posts: 0
Joined: Fri Aug 13, 2010 3:24 pm

Setting the Panel's HTML property from a javascript routine

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?

Andy Parker
Posts: 0
Joined: Wed Mar 27, 2013 10:21 am

Setting the Panel's HTML property from a javascript routine

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

Return to “Issues”