File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

what wrong with my code ?

 
somu sundar
Greenhorn
Posts: 8
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all....
<script type="text/javascript">
var queryString = "?";

function appendToUrl(link,number){
queryString +="&type=page&status="+userlist.status.value+"&numberview="+userlist.numberview.value+"&link="+number;
alert(queryString);
location.href=link+queryString;
}
</script>
<form>
<a href='javascript:appendToUrl("http://host:8080/JspServlet/NewAdmin.do",1)'>clickme</a>
</form>

i have tried to call my script while click the alink... but when i tried in eclipse default browser working properly ... but not in other browser like ie,mozila....
can any one help me to solve this problem......
thanks in advance....
 
Ashwini Kashyap
Ranch Hand
Posts: 90
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Somu,

The problem is occuring due to formation of wrong query string.
Its getting appended like :
?&type=page&status="+userlist.status.value+"&numberview="+userlist.numberview.value+"&link="+number;
which is incorrect.

It should be like: ?type=page&status="+userlist.status.value+"&numberview="+userlist.numberview.value+"&link="+number;

Hope this helps.

Thanks and Regards,
Ashwini Kashyap | akashyap@infocepts.com | www.infocepts.com
 
Seetharaman Venkatasamy
Ranch Hand
Posts: 5575
Eclipse IDE Java Windows XP
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
you are requesting to host at port 8080. is that *localhost*?
 
Seetharaman Venkatasamy
Ranch Hand
Posts: 5575
Eclipse IDE Java Windows XP
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to JavaRanch somu sundar
 
somu sundar
Greenhorn
Posts: 8
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks.... now its working ... :)
 
somu sundar
Greenhorn
Posts: 8
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Seetharaman Venkatasamy wrote:Welcome to JavaRanch somu sundar
thank u...
 
Seetharaman Venkatasamy
Ranch Hand
Posts: 5575
Eclipse IDE Java Windows XP
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
you are welcome
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic