# Starting Boilerplate JS Code

At the top of the script, we can add `//# sourceURL=RAD.js` to make debugging easier. This will allow us to locate the file using the Chrome debugger by searching for RAD.js in the Sources tab. We are also preventing the code from running inside the editor with a simple if check.

```
//# sourceURL=RAD.js
var rad = Radical.getAdByWindow(window);
var container = rad.getContainer();
var inScreenshot = window.location.href.indexOf('preview?screenshot=1') > -1 ? true : false;
if (!rad.getMergedContent().inEditor) { 
	rad.onLoad(onAdLoaded);
	rad.onRender(onAdRender);
	rad.onBeforeRender(onBeforeRender);
}
function onAdRender() {
	var background = rad.getElementById('e2');
}

//{ elementDefs:elementDefs, elementStyles:elementStyles }
function onBeforeRender(arg) {
	arg.elementStyles['e2'].visible = false;
}

function onAdLoaded() {

}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.responsiveads.com/developers/code-examples/starting-boilerplate-js-code.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
