This question is locked. New answers and comments are not allowed.
Hi, I am trying to pass and Id to a page through the url like below
The id is being set but how do i then retrieve that Id from the url??
Thanks,
Adrian
aTag.setAttribute(
'href'
,
"#page-home?uid="
+ data.result[i].Id);
The id is being set but how do i then retrieve that Id from the url??
Thanks,
Adrian
4 Answers, 1 is accepted
0
Hi Adrian,
Could you please specify what kind of application are you building - is it an AppBuilder app built with Kendo UI Mobile, jQuery Mobile, etc., or a web application? Parsing a query string is somewhat a generic task with JavaScript.
For example, in a web application, you can parse the query string from the URL in a similar way:
Kendo UI framework will pass an event when the view is loaded, for example in the show event. Please, refer to the following:
Please, let us know if you have further questions.
Regards,
Anton Dobrev
Telerik
Could you please specify what kind of application are you building - is it an AppBuilder app built with Kendo UI Mobile, jQuery Mobile, etc., or a web application? Parsing a query string is somewhat a generic task with JavaScript.
For example, in a web application, you can parse the query string from the URL in a similar way:
var
currentId = (window.location.href.split(
'='
))[1];
Kendo UI framework will pass an event when the view is loaded, for example in the show event. Please, refer to the following:
var
currentId = e.view.params.uid;
Please, let us know if you have further questions.
Regards,
Anton Dobrev
Telerik
Everlive is now Telerik Backend Services, and is part of the Telerik Platform.
0
Adrian
Top achievements
Rank 1
answered on 03 Apr 2014, 08:54 AM
Hi Anton,
Sorry it is a JQuery Mobile template that I started the application with
Thanks
Sorry it is a JQuery Mobile template that I started the application with
Thanks
0
Hi Adrian,
Thanks for specifying, the previous suggestions remain valid, and there is also a portion of utility methods in the jQuery mobile API, along with a ParseUrl() method. When obtaining the search segment of the URL (the substring after the '?' char) you can parse it. There are a lot of community threads on this, for example this one.
Regards,
Anton Dobrev
Telerik
Thanks for specifying, the previous suggestions remain valid, and there is also a portion of utility methods in the jQuery mobile API, along with a ParseUrl() method. When obtaining the search segment of the URL (the substring after the '?' char) you can parse it. There are a lot of community threads on this, for example this one.
Regards,
Anton Dobrev
Telerik
Everlive is now Telerik Backend Services, and is part of the Telerik Platform.
0
balmer
Top achievements
Rank 1
answered on 29 Oct 2015, 05:48 AM
try this .....
function getQueryVal(name) {
name = name.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]");
var regex = new RegExp("[\\?&]" + name + "=([^&#]*)"),
results = regex.exec(location.search);
return results === null ? "" : decodeURIComponent(results[1].replace(/\+/g, " "));
}
Full Source : http://www.corelangs.com/js/basics/query.html
Balmer