team2005
asked on
My website popupwindow dosent work now ?
Hi!
Have this code to popup a window, to ask
user to enter a postnr...
<script type="text/javascript">
//<![CDATA[
var showPrompt = function(){
$husk_postnr2=prompt("Legg inn postnummer","Postnummer");
if ($husk_postnr2!=""){
/*insert the store script, use what you want*/
window.location=href+"&pos tnr="+husk _postnr2;
}
return false;
}
//]]>
</script>
<h2>Hvem er dere?</h2>
<a href="http://dugnaden.no/tjen-penger/?preset=klasse&;[husk_postnr2]"></a >
<div class="knapp" style="float: left;">
<h4><a href="http://dugnaden.no/tjen-penger/?preset=klasse&;[husk_postnr2]" onclick="return showPrompt(this.title);">< img title="klasse" src="http://dugnaden.no/wp-content/uploads/2009/10/klasse.png" alt="klasse" width="90" height="50" />
Skoleklasse</a></h4></div>
But the window dosent show up ???
What is wrong ?
Have this code to popup a window, to ask
user to enter a postnr...
<script type="text/javascript">
//<![CDATA[
var showPrompt = function(){
$husk_postnr2=prompt("Legg
if ($husk_postnr2!=""){
/*insert the store script, use what you want*/
window.location=href+"&pos
}
return false;
}
//]]>
</script>
<h2>Hvem er dere?</h2>
<a href="http://dugnaden.no/tjen-penger/?preset=klasse&;[husk_postnr2]"></a
<div class="knapp" style="float: left;">
<h4><a href="http://dugnaden.no/tjen-penger/?preset=klasse&;[husk_postnr2]" onclick="return showPrompt(this.title);"><
Skoleklasse</a></h4></div>
But the window dosent show up ???
What is wrong ?
btw i copied your script:
and the prompt window is displayed..
<html>
<head><script type="text/javascript">
//<![CDATA[
var showPrompt = function(){
$husk_postnr2=prompt("Legg inn postnummer");
if ($husk_postnr2!=""){
/*insert the store script, use what you want*/
window.location=href+"&postnr="+husk_postnr2;
}
return false;
}
//]]>
</script>
</head>
<body>
<h2>Hvem er dere?</h2>
<a href="http://dugnaden.no/tjen-penger/?preset=klasse&[husk_postnr2]"></a>
<div class="knapp" style="float: left;">
<h4><a href="http://dugnaden.no/tjen-penger/?preset=klasse&[husk_postnr2]" onclick="return showPrompt(this.title);"><img title="klasse" src="http://dugnaden.no/wp-content/uploads/2009/10/klasse.png" alt="klasse" width="90" height="50" />
Skoleklasse</a></h4></div>
</body>
</html>
and the prompt window is displayed..
ASKER
Whys dosent it work on my computer ?
I am using Firefox
I am using Firefox
I am also using firefox, maybe you have javascript disabled, go to tools->options->content->e nable java script
and also try the script in ie or another browser.
and also try the script in ie or another browser.
ASKER
Javascript is enabled in firefox..
If you enter example: 3100
Do you see postnr=3100 in the url ?
Olso tryed this in IE, but there it say that its a error on the page ?
If you enter example: 3100
Do you see postnr=3100 in the url ?
Olso tryed this in IE, but there it say that its a error on the page ?
with the code that you posted nothing is sent to the url because you put the onclick event on a <a> tag and it follows the link from href first instead of the window.location from js.
ASKER
Hi!
How do i send this to url then ?
How do i send this to url then ?
window.location=href+"&husk_postnr2="+husk_postnr2;
with this line, but you have this already added you only have to remove the <a> tag and replace it with:<div style="cursor: pointer" title="http://dugnaden.no/tjen-penger/?preset=russ" onclick="showPrompt(this.title)">
<img title="russ" src="http://dugnaden.no/wp-content/uploads/2009/10/russ.png" alt="russ" width="90" height="50" />
</div>
post the code you have so far, including the <html></html> tags and i will modify it for you.
ASKER
Hi!
This is the code i have now:
This is the code i have now:
<script type="text/javascript">
//<![CDATA[
var showPrompt = function(href){
$husk_postnr2=prompt("Legg inn postnummer");
if ($husk_postnr2!=""){
/*insert the store script, use what you want*/
window.location=href+"&postnr="+husk_postnr2;
}
return false;
}
//]]>
</script>
<span style="font-size: 1.4em; line-height: 1.5em;">Vi selger sekker med toalettpapir og tørkeruller som dere kan selge videre gjennom dugnad med god fortjeneste!</span>
[husk_postnr2];
MINSTE-BESTILLING 40 SEKKER
<h2>Hvem er dere?</h2>
<a href="http://dugnaden.no/tjen-penger/?preset=klasse&;[husk_postnr2]"></a>
<div class="knapp" style="float: left;">
<h4><a href="http://dugnaden.no/tjen-penger/?preset=klasse&[husk_postnr2]" onclick="return showPrompt("http://dugnaden.no/tjen-penger/?preset=klasse&[husk_postnr2]");"><img title="klasse" src="http://dugnaden.no/wp-content/uploads/2009/10/klasse.png" alt="klasse" width="90" height="50" />
Skoleklasse</a></h4></div>
<a href="http://dugnaden.no/tjen-penger/?preset=russ&[husk_postnr2]"></a>
<div class="knapp" style="float: left;">
<h4><a href="http://dugnaden.no/tjen-penger/?preset=russ&[husk_postnr2]" onclick="return showPrompt(this.title);"><img title="russ" src="http://dugnaden.no/wp-content/uploads/2009/10/russ.png" alt="russ" width="90" height="50" />
Russ</a></h4></div>
<a href="http://dugnaden.no/tjen-penger/?preset=idrettslag&[husk_postnr2]"></a>
<div class="knapp" style="float: left;">
<h4><a href="http://dugnaden.no/tjen-penger/?preset=idrettslag&[husk_postnr2]" onclick="return showPrompt(this.title);"><img title="idrettslag" src="http://dugnaden.no/wp-content/uploads/2009/10/idrettslag.png" alt="idrettslag" width="90" height="50" />
Idrettslag</a></h4>
</div>
<a href="http://dugnaden.no/tjen-penger/?preset=korpsogkor&[husk_postnr2]"></a>
<div class="knapp" style="float: left;">
<h4><a href="http://dugnaden.no/tjen-penger/?preset=korpsogkor&[husk_postnr2]" onclick="return showPrompt(this.title);"><img title="korpsogkor" src="http://dugnaden.no/wp-content/uploads/2009/10/korpsogkor.png" alt="korpsogkor" width="90" height="50" />
Korps/kor</a></h4>
</div>
<a href="http://dugnaden.no/tjen-penger/?preset=annen&[husk_postnr2]"></a>
<div class="knapp" style="float: left; padding-top: 0px;">
<h4><a href="http://dugnaden.no/tjen-penger/?preset=annen&[husk_postnr2]" onclick="return showPrompt(this.title);"><img title="annen" src="http://dugnaden.no/wp-content/uploads/2009/10/annen.png" alt="annen" width="90" height="50" />
Annen forening</a></h4>
</div>
<a href="http://dugnaden.no/produkter/"><img class="size-full wp-image-495" title="Våre produkter" src="http://dugnaden.no/wp-content/uploads/2009/10/produkter2.jpg" alt="Tørkeruller og toalettpapir" width="650" height="390" /></a>
<html>
<head>
<script type="text/javascript">
//<![CDATA[
var showPrompt = function(href){
husk_postnr2=prompt("Legg inn postnummer");
if (husk_postnr2!=""){
window.location=href+"&postnr="+husk_postnr2;
}
return false;
}
//]]>
</script>
</head>
<body>
<span style="font-size: 1.4em; line-height: 1.5em;">Vi selger sekker med toalettpapir og tørkeruller som dere kan selge videre gjennom dugnad med god fortjeneste!</span>
[husk_postnr2];
MINSTE-BESTILLING 40 SEKKER
<h2>Hvem er dere?</h2>
<a href="http://dugnaden.no/tjen-penger/?preset=klasse&;[husk_postnr2]"></a>
<div class="knapp" style="float: left;">
<div style="cursor: pointer; display: inline-table;" onclick="showPrompt('http://dugnaden.no/tjen-penger/?preset=klasse&[husk_postnr2]')">
<img title="klasse" src="http://dugnaden.no/wp-content/uploads/2009/10/klasse.png" alt="klasse" width="90" height="50" />
<h4>Skoleklasse</h4></div>
<div style="cursor: pointer; display: inline-table;" onclick="showPrompt('http://dugnaden.no/tjen-penger/?preset=russ&[husk_postnr2]')">
<img title="russ" src="http://dugnaden.no/wp-content/uploads/2009/10/russ.png" alt="russ" width="90" height="50" />
<h4>Russ</h4></div>
<div style="cursor: pointer; display: inline-table;" onclick="showPrompt('http://dugnaden.no/tjen-penger/?preset=idrettslag&[husk_postnr2]')">
<img title="idrettslag" src="http://dugnaden.no/wp-content/uploads/2009/10/idrettslag.png" alt="idrettslag" width="90" height="50" />
<h4>Idrettslag</h4></div>
<div style="cursor: pointer; display: inline-table;" onclick="showPrompt('http://dugnaden.no/tjen-penger/?preset=korpsogkor&[husk_postnr2]')">
<img title="korpsogkor" src="http://dugnaden.no/wp-content/uploads/2009/10/korpsogkor.png" alt="korpsogkor" width="90" height="50" />
<h4>Korps/kor</h4></div>
<div style="cursor: pointer; display: inline-table;" onclick="showPrompt('http://dugnaden.no/tjen-penger/?preset=annen&[husk_postnr2]')">
<img title="annen" src="http://dugnaden.no/wp-content/uploads/2009/10/annen.png" alt="annen" width="90" height="50" />
<h4>Annen forening</h4></div>
<br/>
<a href="http://dugnaden.no/produkter/"><img class="size-full wp-image-495" title="Våre produkter" src="http://dugnaden.no/wp-content/uploads/2009/10/produkter2.jpg" alt="Tørkeruller og toalettpapir" width="650" height="390" /></a>
</body>
</html>
your first mistake was that you put a $ sign in front of the js variables
$husk_postnr2
and that made then not pass the validation test.
Be more carefull, js doesn't have $ in front of variables.
$husk_postnr2
and that made then not pass the validation test.
Be more carefull, js doesn't have $ in front of variables.
ASKER
Hi!
Your code dosent work, its show the pictures
in 5 rows... Not on 1 line ?
And http://.... after enter number is:
http://dugnaden.no/tjen-penger/?preset=klasse#038;postnr=3100
Your code dosent work, its show the pictures
in 5 rows... Not on 1 line ?
And http://.... after enter number is:
http://dugnaden.no/tjen-penger/?preset=klasse#038;postnr=3100
<html>
<head>
<script type="text/javascript">
//<![CDATA[
var showPrompt = function(href){
husk_postnr2=prompt("Legg inn postnummer");
if (husk_postnr2!=""&&husk_postnr2!=null){
/*insert the store script, use what you want*/
window.location=href+"&postnr="+husk_postnr2;
}
return false;
}
//]]>
</script>
</head>
<body>
<span style="font-size: 1.4em; line-height: 1.5em;">Vi selger sekker med toalettpapir og tørkeruller som dere kan selge videre gjennom dugnad med god fortjeneste!</span>
[husk_postnr2];
MINSTE-BESTILLING 40 SEKKER
<h2>Hvem er dere?</h2>
<div class="knapp" style="float: left;" onclick="return showPrompt('http://dugnaden.no/tjen-penger/?preset=klasse&[husk_postnr2]');">
<h4><img title="klasse" src="http://dugnaden.no/wp-content/uploads/2009/10/klasse.png" alt="klasse" width="90" height="50" />
Skoleklasse</h4></div>
<div class="knapp" style="float: left;" onclick="return showPrompt('http://dugnaden.no/tjen-penger/?preset=russ&[husk_postnr2]');">
<h4><img title="russ" src="http://dugnaden.no/wp-content/uploads/2009/10/russ.png" alt="russ" width="90" height="50" />
Russ</h4></div>
<div class="knapp" style="float: left;" onclick="return showPrompt('http://dugnaden.no/tjen-penger/?preset=idrettslag&[husk_postnr2]');">
<h4><img title="idrettslag" src="http://dugnaden.no/wp-content/uploads/2009/10/idrettslag.png" alt="idrettslag" width="90" height="50" />
Idrettslag</h4>
</div>
<div class="knapp" style="float: left;" onclick="return showPrompt('http://dugnaden.no/tjen-penger/?preset=korpsogkor&[husk_postnr2]');">
<h4><img title="korpsogkor" src="http://dugnaden.no/wp-content/uploads/2009/10/korpsogkor.png" alt="korpsogkor" width="90" height="50" />
Korps/kor</h4>
</div>
<div class="knapp" style="float: left; padding-top: 0px;" onclick="return showPrompt('http://dugnaden.no/tjen-penger/?preset=annen&[husk_postnr2]');">
<h4><img title="annen" src="http://dugnaden.no/wp-content/uploads/2009/10/annen.png" alt="annen" width="90" height="50" />
Annen forening</h4>
</div>
<a href="http://dugnaden.no/produkter/"><img class="size-full wp-image-495" title="Våre produkter" src="http://dugnaden.no/wp-content/uploads/2009/10/produkter2.jpg" alt="Tørkeruller og toalettpapir" width="650" height="390" /></a>
</body></html>
now this is it :D
ASKER
some of your mistakes:
above you use double quotes also inside the string, that brakes it, you should use it like this:
these empty <a> tags did nothing so i removed them:
What you did good and i didn't was with the float left, i user display: inline-table, which only worked in FF..
In the above code we want to remove the <a> tag because that if we click it will go to the href adress regardless of what we do, and we don't want that, we want control. So remove the <a> tag and add the onclick event with the adress from <a>'s href and were golden, like in my example posted earlier.
Hope you manage. Good luck!
onclick="return showPrompt("http://dugnaden.no/tjen-penger/?preset=klasse&[husk_postnr2]");"
above you use double quotes also inside the string, that brakes it, you should use it like this:
onclick="return showPrompt('http://dugnaden.no/tjen-penger/?preset=klasse&[husk_postnr2]');"
these empty <a> tags did nothing so i removed them:
<a href="http://dugnaden.no/tjen-penger/?preset=klasse&;[husk_postnr2]"></a>
What you did good and i didn't was with the float left, i user display: inline-table, which only worked in FF..
<div class="knapp" style="float: left;">
<h4><a href="http://dugnaden.no/tjen-penger/?preset=klasse&[husk_postnr2]" onclick="return showPrompt("http://dugnaden.no/tjen-penger/?preset=klasse&[husk_postnr2]");"><img title="klasse" src="http://dugnaden.no/wp-content/uploads/2009/10/klasse.png" alt="klasse" width="90" height="50" />
Skoleklasse</a></h4></div>
In the above code we want to remove the <a> tag because that if we click it will go to the href adress regardless of what we do, and we don't want that, we want control. So remove the <a> tag and add the onclick event with the adress from <a>'s href and were golden, like in my example posted earlier.
Hope you manage. Good luck!
illegal character
[Break On This Error] if (husk_postnr2!=""&� 38;husk_po stnr2!=nul l){
put the cdata characters back cause it transformes the & in the above &..
on this div
add like this:
[Break On This Error] if (husk_postnr2!=""&�
put the cdata characters back cause it transformes the & in the above &..
on this div
<div class="knapp" style="float: left;">
add like this:
<div class="knapp" style="float: left; cursor: pointer" >
ASKER
<div id="blog-body">
<div id="content" class="narrowcolumn">
<div class="post" id="post-25">
<h2>Tjen penger på noe alle trenger!</h2>
<div class="entry">
<p><html><br />
<head><br />
<script type="text/javascript">
//<![CDATA[
var showPrompt = function(href){
husk_postnr2=prompt("Legg inn postnummer");
if (husk_postnr2!=""&&husk_postnr2!=null){
/*insert the store script, use what you want*/
window.location=href+"&postnr="+husk_postnr2;
}
return false;
}
//]]>
</script><br />
</head><br />
<body><br />
you can't have 2 head tags!
insert the code below in your main head tag, if you don't do this then the images won't be clickable!
<script type="text/javascript">
//<![CDATA[
var showPrompt = function(href){
husk_postnr2=prompt("Legg inn postnummer");
if (husk_postnr2!=""&&husk_postnr2!=null){
window.location=href+"&postnr="+husk_postnr2;
}
return false;
}
//]]>
</script>
could you attach the php file in question so i can edit it more fast?
ASKER
Hi!
I removed the head tag, but still cant click on pictures
Code i tryed now:
I removed the head tag, but still cant click on pictures
Code i tryed now:
<script type="text/javascript">
//<![CDATA[
var showPrompt = function(href){
husk_postnr2=prompt("Legg inn postnummer");
if (husk_postnr2!=""&&husk_postnr2!=null){
/*insert the store script, use what you want*/
window.location=href+"&postnr="+husk_postnr2;
}
return false;
}
//]]>
</script>
<span style="font-size: 1.4em; line-height: 1.5em;">Vi selger sekker med toalettpapir og tørkeruller som dere kan selge videre gjennom dugnad med god fortjeneste!</span>
MINSTE-BESTILLING 40 SEKKER
<h2>Hvem er dere?</h2>
<div class="knapp" style="float: left;" onclick="return showPrompt('http://dugnaden.no/tjen-penger/?preset=klasse&[husk_postnr2]');">
<h4><img title="klasse" src="http://dugnaden.no/wp-content/uploads/2009/10/klasse.png" alt="klasse" width="90" height="50" />
Skoleklasse</h4></div>
<div class="knapp" style="float: left;" onclick="return showPrompt('http://dugnaden.no/tjen-penger/?preset=russ&[husk_postnr2]');">
<h4><img title="russ" src="http://dugnaden.no/wp-content/uploads/2009/10/russ.png" alt="russ" width="90" height="50" />
Russ</h4></div>
<div class="knapp" style="float: left;" onclick="return showPrompt('http://dugnaden.no/tjen-penger/?preset=idrettslag&[husk_postnr2]');">
<h4><img title="idrettslag" src="http://dugnaden.no/wp-content/uploads/2009/10/idrettslag.png" alt="idrettslag" width="90" height="50" />
Idrettslag</h4>
</div>
<div class="knapp" style="float: left;" onclick="return showPrompt('http://dugnaden.no/tjen-penger/?preset=korpsogkor&[husk_postnr2]');">
<h4><img title="korpsogkor" src="http://dugnaden.no/wp-content/uploads/2009/10/korpsogkor.png" alt="korpsogkor" width="90" height="50" />
Korps/kor</h4>
</div>
<div class="knapp" style="float: left; padding-top: 0px;" onclick="return showPrompt('http://dugnaden.no/tjen-penger/?preset=annen&[husk_postnr2]');">
<h4><img title="annen" src="http://dugnaden.no/wp-content/uploads/2009/10/annen.png" alt="annen" width="90" height="50" />
Annen forening</h4>
</div>
<a href="http://dugnaden.no/produkter/"><img class="size-full wp-image-495" title="Våre produkter" src="http://dugnaden.no/wp-content/uploads/2009/10/produkter2.jpg" alt="Tørkeruller og toalettpapir" width="650" height="390" /></a>
I can't be sure that you place all the scripts in the right place, could you please upload the php file so i can take a look at the whole document?
ASKER
Hi!
The code is not in a php-file.
Its stored in mysql database
I am using CMS system wordpress
The code is not in a php-file.
Its stored in mysql database
I am using CMS system wordpress
<div class="knapp" style="float: left;"
modify the above line into:
<div class="knapp" style="float: left; cursor: pointer;"
modify the above line into:
<div class="knapp" style="float: left; cursor: pointer;"
Ok, then just paste the whole text from the database to a text file and upload that.
ASKER
Tryed that now, now itsshows the pointer cursor..
But cant click on picture ?
But cant click on picture ?
if you click the picture does the prompt appear?
ASKER
Hi!
No
No
ok, then there is something wrong with the javascript, it maybe changed the & or the > < characters or are you sure it is at the top of file in the head tag?
ASKER
Aha
It dosent like this line in the script:
if (husk_postnr2!=""&&husk_po stnr2!=nul l){
I changed it to:
if (husk_postnr2!=""){
Then it working again, but the page shows this in the url:
http://dugnaden.no/tjen-penger/?preset=klasse#038;postnr=3100
Must be:
http://dugnaden.no/tjen-penger/?preset=klasse&postnr=3100
It dosent like this line in the script:
if (husk_postnr2!=""&&husk_po
I changed it to:
if (husk_postnr2!=""){
Then it working again, but the page shows this in the url:
http://dugnaden.no/tjen-penger/?preset=klasse#038;postnr=3100
Must be:
http://dugnaden.no/tjen-penger/?preset=klasse&postnr=3100
Replace & with &
another thing, because you edit from admin panel you can't insert anything in the documents <head> tag, that can only done by directly editing your hearder.php file from the wordpress theme directory.
The most correct way to use the script below is to manual edit that file.
This is how you edit it:
First of all you must have access to the server via ftp or ssh or cpanel.
Navigate to wordpress/wp-content/theme s/your_the me_name/he ader.php
And insert the above code before the </head> tag.
The most correct way to use the script below is to manual edit that file.
<script type="text/javascript">
//<![CDATA[
var showPrompt = function(href){
husk_postnr2=prompt("Legg inn postnummer");
if (husk_postnr2!=""&&husk_postnr2!=null){
window.location=href+"&postnr="+husk_postnr2;
}
return false;
}
//]]>
</script>
This is how you edit it:
First of all you must have access to the server via ftp or ssh or cpanel.
Navigate to wordpress/wp-content/theme
And insert the above code before the </head> tag.
ASKER
Hi!
Working now, with the included code:
But when i run this in IE, it dosent work
Working now, with the included code:
But when i run this in IE, it dosent work
<script type="text/javascript">
//<![CDATA[
var showPrompt = function(href){
husk_postnr2=prompt("Legg inn postnummer");
if (husk_postnr2!=""){
/*insert the store script, use what you want*/
window.location=href+"postnr="+husk_postnr2;
}
return false;
}
//]]>
</script>
<span style="font-size: 1.4em; line-height: 1.5em;">Vi selger sekker med toalettpapir og tørkeruller som dere kan selge videre gjennom dugnad med god fortjeneste!</span>
MINSTE-BESTILLING 40 SEKKER
<h2>Hvem er dere?</h2>
<div class="knapp" style="float: left; cursor: pointer;" onclick="return showPrompt('http://dugnaden.no/tjen-penger/?preset=klasse&');">
<h4><img title="klasse" src="http://dugnaden.no/wp-content/uploads/2009/10/klasse.png" alt="klasse" width="90" height="50" />
Skoleklasse</h4></div>
<div class="knapp" style="float: left; cursor: pointer;" onclick="return showPrompt('http://dugnaden.no/tjen-penger/?preset=russ&');">
<h4><img title="russ" src="http://dugnaden.no/wp-content/uploads/2009/10/russ.png" alt="russ" width="90" height="50" />
Russ</h4></div>
<div class="knapp" style="float: left; cursor: pointer;" onclick="return showPrompt('http://dugnaden.no/tjen-penger/?preset=idrettslag&');">
<h4><img title="idrettslag" src="http://dugnaden.no/wp-content/uploads/2009/10/idrettslag.png" alt="idrettslag" width="90" height="50" />
Idrettslag</h4>
</div>
<div class="knapp" style="float: left; cursor: pointer;" onclick="return showPrompt('http://dugnaden.no/tjen-penger/?preset=korpsogkor&');">
<h4><img title="korpsogkor" src="http://dugnaden.no/wp-content/uploads/2009/10/korpsogkor.png" alt="korpsogkor" width="90" height="50" />
Korps/kor</h4>
</div>
<div class="knapp" style="float: left; cursor: pointer; padding-top: 0px;" onclick="return showPrompt('http://dugnaden.no/tjen-penger/?preset=annen&');">
<h4><img title="annen" src="http://dugnaden.no/wp-content/uploads/2009/10/annen.png" alt="annen" width="90" height="50" />
Annen forening</h4>
</div>
<a href="http://dugnaden.no/produkter/"><img class="size-full wp-image-495" title="Våre produkter" src="http://dugnaden.no/wp-content/uploads/2009/10/produkter2.jpg" alt="Tørkeruller og toalettpapir" width="650" height="390" /></a>
please user this code:
i see that u didn't change it..
I think you didn't enable activx control in IE, cause it work for me, what IE version do you have?
Try it out in Chrome or Opera or Safari.
<script type="text/javascript">
//<![CDATA[
var showPrompt = function(href){
husk_postnr2=prompt("Legg inn postnummer");
if (husk_postnr2!=""&&husk_postnr2!=null){
window.location=href+"&postnr="+husk_postnr2;
}
return false;
}
//]]>
</script>
i see that u didn't change it..
I think you didn't enable activx control in IE, cause it work for me, what IE version do you have?
Try it out in Chrome or Opera or Safari.
it does that on IE because the statement with !=null is not present, please correct that!
ASKER
Hi!
If i correct this in the script to:
if (husk_postnr2!=""&&husk_po stnr2!=nul l){
It dosent work ?
Driving me crazy soon
If i correct this in the script to:
if (husk_postnr2!=""&&husk_po
It dosent work ?
Driving me crazy soon
ASKER
Hi!
Cant use this line in script
if (husk_postnr2!=""&&husk_po stnr2!=nul l){
But i change it to this:
if (husk_postnr2!=""){
/*insert the store script, use what you want*/
window.location=href+"post nr="+husk_ postnr2;
}
if (husk_postnr2!=null){
/*insert the store script, use what you want*/
window.location=href+"post nr="+husk_ postnr2;
}
Cant use this line in script
if (husk_postnr2!=""&&husk_po
But i change it to this:
if (husk_postnr2!=""){
/*insert the store script, use what you want*/
window.location=href+"post
}
if (husk_postnr2!=null){
/*insert the store script, use what you want*/
window.location=href+"post
}
listen to me please the only way to get this properly done is to edit the header.php file in ur theme
this is why:
//<![CDATA[
var showPrompt = function(href){
husk_postnr2=prompt("Legg inn postnummer");
if (husk_postnr2!=""&� 38;husk_po stnr2!=nul l){
/*insert the store script, use what you want*/
window.location=href+"post nr="+husk_ postnr2;
}
return false;
}
//]]>
see all the strange characters? when you insert javascript in the wordpress editor it parses it and transforms for security reasons all < > & characters
please if you can edit the header file like i said above, if you do that right i guarantee that it will work perfectly.
this is why:
//<![CDATA[
var showPrompt = function(href){
husk_postnr2=prompt("Legg inn postnummer");
if (husk_postnr2!=""&�
/*insert the store script, use what you want*/
window.location=href+"post
}
return false;
}
//]]>
see all the strange characters? when you insert javascript in the wordpress editor it parses it and transforms for security reasons all < > & characters
please if you can edit the header file like i said above, if you do that right i guarantee that it will work perfectly.
if (husk_postnr2!=""){
/*insert the store script, use what you want*/
window.location=href+"&postnr="+husk_postnr2;
}
else
if (husk_postnr2!=null){
/*insert the store script, use what you want*/
window.location=href+"&postnr="+husk_postnr2;
}
make the bolded changes also
/*insert the store script, use what you want*/
window.location=href+"&postnr="+husk_postnr2;
}
else
if (husk_postnr2!=null){
/*insert the store script, use what you want*/
window.location=href+"&postnr="+husk_postnr2;
}
make the bolded changes also
ASKER
Hi!
Aha, so i must then remove the script from the Page
where it is now, and put it in header.php insted ?
Aha, so i must then remove the script from the Page
where it is now, and put it in header.php insted ?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
I look at the page and you didn't put what i said, please follow my instructions strictly or we will never be done..
ASKER
Hi!
Now i put the script in header.php
With this code:
<script type="text/javascript">
//<![CDATA[
var showPrompt = function(href){
husk_postnr2=prompt("Legg inn postnummer");
if (husk_postnr2!=""){
/*insert the store script, use what you want*/
window.location=href+"& ;postnr="+ husk_postn r2;
}
else
if (husk_postnr2!=null){
/*insert the store script, use what you want*/
window.location=href+"& ;postnr="+ husk_postn r2;
}
return false;
}
//]]>
</script>
After i input the number its showing this url:
http://dugnaden.no/tjen-penger/?preset=klasse&postnr=3100
???
Now i put the script in header.php
With this code:
<script type="text/javascript">
//<![CDATA[
var showPrompt = function(href){
husk_postnr2=prompt("Legg inn postnummer");
if (husk_postnr2!=""){
/*insert the store script, use what you want*/
window.location=href+"&
}
else
if (husk_postnr2!=null){
/*insert the store script, use what you want*/
window.location=href+"&
}
return false;
}
//]]>
</script>
After i input the number its showing this url:
http://dugnaden.no/tjen-penger/?preset=klasse&postnr=3100
???
Please read my previous posts and redo the part with header.php, the code that you inserted has flaws i won't go into details but please do it.
ASKER
Thanks
Good luck!
Open in new window
i gave you this solution that is good, what is the problem?