Hi,
I get the follow problem.
A page is locate in C:\Directory\fi les\pag1.php
There I call the function setUrl. (all the functions are located in
C:\Directory\in cludes
function setUrl()
{
var ckyDatum = new Date;
ckyDatum.setDat e(ckyDatum.getD ate()+7);
var href = document.locati on.href;
the_cookie = escape(href);
document.cookie = 'test=' + the_cookie + '; path=/;' ;
alert(document. cookie);
}
This is OK : the alert results in ' test =
C\Directory\fil es\pag1.php
In a page located in C:\Directory\su b\pag5.php I call the function getUrl
<script language="JavaS cript">
getUrl();
</script>
function getUrl()
{
var resultaat;
resultaat = leesUrl('test') ;
alert(resultaat ); //OK
The alert results in
C\Directory\fil es\pag1.php
document.write ("<a href="+ resultaat + "><img
border='0'src=' ../afbeeldingen/Algemeen/terugbr.gif'></a>");
!!!!!!!!!!!!!!! !!!//this is not good. I get the follow a href:
C:\Directory\su b\c\Directory\f iles\pag1.php
}
function leesUrl(cookieN ame)
{
cookie_array = document.cookie .split ("; ")
for (x=0; x < cookie_array.le ngth; x++)
{
cookieParts_arr ay = cookie_array[x].split("=")
if (cookieParts_ar ray[0] == cookieName)
{
alert (cookieParts_ar ray[1]);
return cookieParts_arr ay[1];
}
}
}
What's wrong?
Alain
I get the follow problem.
A page is locate in C:\Directory\fi les\pag1.php
There I call the function setUrl. (all the functions are located in
C:\Directory\in cludes
function setUrl()
{
var ckyDatum = new Date;
ckyDatum.setDat e(ckyDatum.getD ate()+7);
var href = document.locati on.href;
the_cookie = escape(href);
document.cookie = 'test=' + the_cookie + '; path=/;' ;
alert(document. cookie);
}
This is OK : the alert results in ' test =
C\Directory\fil es\pag1.php
In a page located in C:\Directory\su b\pag5.php I call the function getUrl
<script language="JavaS cript">
getUrl();
</script>
function getUrl()
{
var resultaat;
resultaat = leesUrl('test') ;
alert(resultaat ); //OK
The alert results in
C\Directory\fil es\pag1.php
document.write ("<a href="+ resultaat + "><img
border='0'src=' ../afbeeldingen/Algemeen/terugbr.gif'></a>");
!!!!!!!!!!!!!!! !!!//this is not good. I get the follow a href:
C:\Directory\su b\c\Directory\f iles\pag1.php
}
function leesUrl(cookieN ame)
{
cookie_array = document.cookie .split ("; ")
for (x=0; x < cookie_array.le ngth; x++)
{
cookieParts_arr ay = cookie_array[x].split("=")
if (cookieParts_ar ray[0] == cookieName)
{
alert (cookieParts_ar ray[1]);
return cookieParts_arr ay[1];
}
}
}
What's wrong?
Alain
Comment