July 16th, 2010, 06:37 PM
Script to save iframe source (cookie?)
i would be very very grateful if someone can help me out here.
i a iframe on my webpage, who's src location if the same domain. as in my other page under the same domain.
what i'd like to do is when a visitor leaves my site, i want the src of the iframe to be saved and when the same visitor visits the site. that last src will load within that iframe.
is this possible.
many many thanks.
August 14th, 2010, 09:49 AM
Depending on ur website if it is just html or is php you can use
which has some snippets
in said snippets has a getCookie(c_name) function
which you can use to get the cookie you are looking for...
c_start=document.cookie.indexOf(c_name + "=");
c_start=c_start + c_name.length+1;
if (c_end==-1) c_end=document.cookie.length;
var exdate=new Date();
document.cookie=c_name+ "=" +escape(value)+
((expiredays==null) ? "" : ";expires="+exdate.toUTCString());
<iframe src="<script>getCookie(url);</script>" extrastuff="here" onchange="setCookie(url,this.src,1"></iframe>
i'm hoping you get the idea...
i havn't tested the above coding but i'm sure you can figure what is going on there.