API:如何从URL中获取值在JQuery或javascript中 [英] API: How to get value from URL In JQuery or javascript

查看:83
本文介绍了API:如何从URL中获取值在JQuery或javascript中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好朋友



我有网址喜欢:



< a href =http://data.mtgox.com/api/1/BTCUSD/ticker> http://data.mtgox.com/api/1/BTCUSD/ticker [ ^ ]





我如何从jquery或javascript获得购买价值



在我的.aspx页面中自我



快速寻找你的帮助....



谢谢

解决方案

< blockquote>如果我理解正确,你想使用JAVASCRIPT读取.aspx文件中查询字符串的值,然后下面是解决方案。





  var  arrPaths =  location  .pathname.split('  /'); 
// arrPaths将是一个数组,如:[,api,1, BTCUSD,自动收报机
// 如果您想要BTCUSD值,那么您可以使用。

var buyValue = arrPaths [ 3 ];





希望这是你想要的。


Hello friends

I Have URL Like :

http://data.mtgox.com/api/1/BTCUSD/ticker[^]


How could i get Buy Value from jquery or javascript

in my .aspx page it self

looking for your help fast ....

thanks

解决方案

If I understood you correctly, you want to read the value from query string in .aspx file using JAVASCRIPT then below is the solution.


var arrPaths = location.pathname.split('/');
//arrPaths will be an array like:[ "", "api", "1", "BTCUSD","ticker"]
//and if you want BTCUSD value then you can use.

var buyValue = arrPaths[3];



Hope this is what you wanted.


这篇关于API:如何从URL中获取值在JQuery或javascript中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆