Question: Can I use JavaScript, or any other non-server script, to read a web page? I'd like my local HTML file (with JavaScript code) to read a internal web page, which is hosted on a web server, and get its entire source code. 

I tried XMLHttpRequest, but I am facing cross-domain issue. Any solution to this? Or any other non-server script that I can use? I already have a few JavaScript functions that I'd be using so want to use your suggested solution and my existing JavaScript code together.

Answer: 
Looks like you are having *leading* or *trailing* *whitespaces* in your `classname`. 

Try using this: -

```
if(classname.trim().equals("edit_body"))

```

This will trim any of those whitespaces at the ends.
equals() is a method of String class. So, it works with double quotes.

```
 if(someString.equals("something")) ✓
 if(someString.equals('something')) ×

```