Jump to content

Force Run JavaScript?


LifeInBinary

Recommended Posts

I have designed a webpage that relies on part of the background image lining up with a JavaScript clock to display properly. When the page first loads, my computer asks me if I want to allow the blocked content. I understand this completely - but if a paranoid user who doesn't know my intentions were to not allow the blocked content, then my page would look like crap. Is there a way to either force the JavaScript to run without questions, or possibly to "hide" or "embed" the JavaScript so that the computer does not know to block it? I assure you, there are no malicious intentions behind this (white hat) :) Another reason for wanting very badly to accomplish this, is that I am building an online portfolio website to display my work to potential people who would pay me to build a website or design graphics - and I have inserted JavaScript into my HTML in order to disable right-clicking and text selection (so that nobody steals my work instead of paying me to do it on a custom level). Yes, I understand that a computer saves everything to cache and if anyone really wants anything online it's very easy to get. But I'm dealing with people who are not very computer literate or internet savy. If they knew enough to steal my work with the JavaScript in place, then they should be able to figure out how to design their own website without paying me. I'm just saying that the JavaScript doesn't do much good if they can just block it from even loading in the first place and start right-clicking away.Another thing is that I have inserted JavaScript to detect screen resolution and inform people that they need to change it in order to properly view the website - so that people are seeing the best-looking presentation possible in order to make a good first impression of my work.So is there a way around this or not?

Link to comment
Share on other sites

YOUR intensions might not be, but others' might be.What you see only appears when the HTML file is ran locally. It won't appear by default when the page is requrested from a web server (even if that server is on the same computer).If you want, you may somehow "inform" the user of the problem and tell them to enable JavaScript.

Link to comment
Share on other sites

Boen Robot, thank you for your reply. I wasn't aware of the fact that this only occurs when ran locally. That sits very well with me. Also, great idea on the whole "inform the user to enable JavaScript" thing. Now that I think of it, I have seen this on many sites. I suppose if I am going to notify them that they should change their resolution and that they should be using IE6 or higher, I should suggest that they enable JavaScript as well.On another note, I am not aware that JavaScript is even capable of malicious intententions - not very serious ones anyway. Isn't it too weak to do any real damage? I have never seen script that could be considered malicious in JavaScript - only more powerful languages such as VB...Anyway, thanks for your input. It helps a lot.

Link to comment
Share on other sites

Hi Life In Binary - most Javascript nasties have been caught by browsers and antivirus software nowadays, but there's always scope with every new version and extensions added that a vulnerability will pop up.Good luck with the site though. If you really want to force users to have Javascript on, you could build the whole site with it - and just show a noscript message otherwise. Horrible for text browsers, worse on your search engine rankings - but it's a thought :)

Link to comment
Share on other sites

JavaScript can still do some damage nowadays even with better browsers. Take gnaa.us for example, when you click on their "Members" link you get attacked with JavaScript scripts and shock images (I have only tried it with Firefox and it almost crashed my computer). I'm not suggesting anyone actually going there, I'm just saying that JS can do some damage.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...