$.extend method with jquery bbq
I d开发者_如何学Pythonefine my routes object (jq bbq) and in some cases i have to add some new/additional to the already existing routes object with
$.extend(this.route, routeArray);
Is there a simple way to remove one route (or multiple routes) in the routearray? The order of the params varies.. Or is there a better way for doing this..?
How could i compare my routeArray with an copy of the previous routearray (lastRoute) and check if only a param changed wich doesn`t require a new ajaxget?
Exists there a easy possibility or have i to iterate over the routes object and check every param in the route object?
need me some advice . .
- Removing - delete routeArray['property']. If routeArray is real array and inherence from Array object, so you can you methods like splice, slice, pop, shift, etc. For more advanced information about delete you can check - http://perfectionkills.com/understanding-delete/
You should compare each element in object with another object. Like this:
for (var i in routeArray) { if (routeArray.hasOwnProperty(i) && routeArrayOriginal[i]) { //... } }
精彩评论