Jump to content
  • 0

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.

 
Link to post
Share on other sites

1 answer to this question

Recommended Posts

  • 0

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.

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...