javascript - Search all pages for a with unique ID -
Is it possible to find all the web pages you have developed (not only the current page on the user's current page) ? If so, how would I go about doing this in javascript? Also, how can I redirect the user to the page in which the ID is placed with unique ID?
If you really want to do this, you can do this if you want to url the pages Know:
(using jQuery)
function search page (url, amm), success, failure) {nextUrl (url, 0); // It calls itself as a callback because $ .load asynchronous function is nextUrl (i) {// This function is assigned to a body # myId for URL $ ('& lt; div' '& gt;) Attempts to load (URL [I] + '' AMM, function () {// if it is loaded, HTML will be if ($ (this) .html ()! == '') Success call ( This URL [i]); // If you have loaded all the pages, then you (i === urls.length) failure.call (this, url [i]); // Otherwise, the function for the next URL To call again Do Else nextUrl (i + 1);}); }; } SearchPages (['/ url1', '/ url2', '/ url3'], 'body # myId', function (url) {console.log (url); // This is the URL that you want to console.log ($ (This)); // $ (this is the div that is loading the body's ames}, fail); // It is called if the page function fails () (warning ('no page found'); };
Comments
Post a Comment