Thread:Talk:ResourceLoader/JavaScript Deprecations/importScript(), importStylesheet()

depracation page declares these methods depracated, and claims that mw.loder replaces them.

however, there is no method in mw.loader that can replace these. of course, one can always use mw.util.wikiGetlink(page) and append the "?action=raw&ctype=text/javascript" manually, but this seems somwewhat pointless - this is exactly what importScript and importStylesheet do for you...

mw.loader.load replaces both importScriptURI and importStylesheetURI successfuly, but not importScript and importStylesheet.

on a completely different note, i would love it if mw.util.wikiGetlink would accept an additional, optional parameter of type "object" that would add parameters: so if i want to get a page with "?action=edit", i would use mw.util.wikiGetlink(pageName, {action: 'edit'}); etc. if the first parameter is an object, this means i want the current page (just like mw.util.wikiGetlink with no parameters), but still append the parameters.

this would be in the spirit of most or all of jQuery, calls, and very much in synch with the way to do ajax in jquery.