You can pass parameters in html file as below
<a href='test.html?foldername=red&imagename=1">Click Here</a>
Here red is folder name and 1 is image name.
How to retrieve the parameters in html
<script type="text/javascript">
var query = location.href.substring((location.href.indexOf('?')+1), location.href.length);
if(location.href.indexOf('?') < 0) query = '';
querysplit = query.split('&');
query = new Array();
for(var i = 0; i < querysplit.length; i++){
var namevalue = querysplit[i].split('=');
namevalue[1] = namevalue[1].replace(/\+/g, ' ');
query[namevalue[0]] = unescape(namevalue[1]);
}
</script>
Or you can download the html file Click Here
<a href='test.html?foldername=red&imagename=1">Click Here</a>
Here red is folder name and 1 is image name.
How to retrieve the parameters in html
<script type="text/javascript">
var query = location.href.substring((location.href.indexOf('?')+1), location.href.length);
if(location.href.indexOf('?') < 0) query = '';
querysplit = query.split('&');
query = new Array();
for(var i = 0; i < querysplit.length; i++){
var namevalue = querysplit[i].split('=');
namevalue[1] = namevalue[1].replace(/\+/g, ' ');
query[namevalue[0]] = unescape(namevalue[1]);
}
</script>
Or you can download the html file Click Here
No comments:
Post a Comment