Jump to content

Archived

This topic is now archived and is closed to further replies.

  • 0
cflapt

Dynamically Change Browser Tab Icon With Parameters

Question

Hi, to add a browser tab icon for a website, you have to reference it inside the <head> section of the page source code, not inside the DataPage. Place the ico address in header: <link rel="shortcut icon" href="ico address">

 

My question: how do I dynamically change the "ico address" with parameters passed by a caspio datapage? I'm currently using direct from caspio deployment method.

 

Thanks.

 

Share this post


Link to post
Share on other sites

1 answer to this question

Recommended Posts

Hi,

 

Insert this code into the footer of your DataPage:

<script type="text/javascript">

var head = document.getElementsByTagName('head')[0\];
var link = document.createElement('link');

link.setAttribute('rel', 'shortcut icon');
link.setAttribute('type', 'image/x-icon');
link.setAttribute('href', '[@URL]');

head.appendChild(link);

</script>

And replace [@URL] with your parameter name.

 

Hope this helps.

Share this post


Link to post
Share on other sites

×
×
  • Create New...