Simple, I'm doing this:
var loc = window.location;
var fltURI=loc.substr(loc.indexOf("hey?hi=")+7, loc.length);
alert(fltURI);
And I'm getting the error. Please explain also why?
Regards
Simple, I'm doing this:
var loc = window.location;
var fltURI=loc.substr(loc.indexOf("hey?hi=")+7, loc.length);
alert(fltURI);
And I'm getting the error. Please explain also why?
Regards
Share Improve this question asked Mar 5, 2017 at 18:40 WjNaWjNa 894 silver badges8 bronze badges2 Answers
Reset to default 4window.location is a Location object, and not a string
Try:
var loc = window.location.toString();
var fltURI=loc.substr(loc.indexOf("hey?hi=")+7, loc.length);
alert(fltURI);
use loc as a string...
var loc = window.location.toString();
alert(loc);
var fltURI=loc.substr(loc.indexOf("hey?hi=")+7, loc.length);
alert(fltURI);
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745115858a4612123.html
评论列表(0条)