javascript - Jquery error sending hex code through get -


here code below...

var o_color ='<?php echo $o_color;?>'; //i have tried urlencode($o_color) var o_color1 =''; 

this code works fine....

   window.location.href = site+"name="+$(this).attr('id')+'&o_color='+o_color; 

but code not work....

   window.location.href = site+"name="+$(this).attr('id')+'&o_color='+o_color+'&o_color1='+o_color1;  note:o_color in hexa code #e34343; 

i jquery error message on console log...

uncaught error: syntax error, unrecognized expression: a[rel=123123&o_color1=]  

try remove double quotes "o_color"

window.location.href = site+"name="+$(this).attr('id')+'&o_color='+ o_color +'&o_color1='+o_color1; 

accroding must be:-

<script> var site='http://localhost/new/'; var o_color = '#e34343'; var o_color1 = ''; window.location.href = site+'name=dfg&o_color='+o_color+'&o_color1='+o_color1; </script> 

Comments

Popular posts from this blog

c# - How to get the current UAC mode -

postgresql - Lazarus + Postgres: incomplete startup packet -

javascript - Ajax jqXHR.status==0 fix error -