Be a Supporter!

Browse Sections

Newgrounds Wiki: Loader

Description This class handles loading various URLs and tracking referral stats.

Note: These calls do not return any JSON packets. Instead, they redirect to the appropriate URL. These calls should be executed in a browser window vs using AJAX or any other internal loaders.

Loader.loadAuthorUrl

Return to Top ^Loads the official URL of the app's author (as defined in your "Official URLs" settings), and logs a referral to your API stats.

For apps with multiple author URLs, use Loader.loadReferral.

Parameters:

host - string
The domain hosting your app. Example: "www.somesite.com", "localHost"

redirect - boolean
Set this to false to get a JSON response containing the URL instead of doing an actual redirect. (optional)

Loader.loadMoreGames

Return to Top ^Loads the Newgrounds game portal, and logs the referral to your API stats.

Parameters:

host - string
The domain hosting your app. Example: "www.somesite.com", "localHost"

redirect - boolean
Set this to false to get a JSON response containing the URL instead of doing an actual redirect. (optional)

Loader.loadNewgrounds

Return to Top ^Loads Newgrounds, and logs the referral to your API stats.

Parameters:

host - string
The domain hosting your app. Example: "www.somesite.com", "localHost"

redirect - boolean
Set this to false to get a JSON response containing the URL instead of doing an actual redirect. (optional)

Loader.loadOfficialUrl

Return to Top ^Loads the official URL where the latest version of your app can be found (as defined in your "Official URLs" settings), and logs a referral to your API stats.

Parameters:

host - string
The domain hosting your app. Example: "www.somesite.com", "localHost"

redirect - boolean
Set this to false to get a JSON response containing the URL instead of doing an actual redirect. (optional)

Loader.loadReferral

Return to Top ^Loads a custom referral URL (as defined in your "Referrals & Events" settings), and logs the referral to your API stats.

Parameters:

host - string
The domain hosting your app. Example: "www.somesite.com", "localHost"

redirect - boolean
Set this to false to get a JSON response containing the URL instead of doing an actual redirect. (optional)