Menu
Hi guys,
I modified a JavaScript and I wondered if it is still OK.
<script language=”JavaScript”>
<!–
if (screen.width>=640)
{
window.location=”pc/index.htm”;
}
//–>
</script>
Is this code ready to use?
Thanks.
Frank
[i]Originally posted by Frank1984 [/i]
[B]I modified a JavaScript and I wondered if it is still OK.[/B][/QUOTE]
[i]Originally posted by agent_x91 [/i]
[B]I've been using javascript "script" tags for years, and have never included a "type" parameter in the tag. It is not required. [/B][/QUOTE]
[i]Originally posted by agent_x91 [/i]Well, you've been doing it wrong since the spring of 1998.
[B]I've been using javascript "script" tags for years, and have never included a "type" parameter in the tag. It is not required. [/B][/QUOTE]
[i]From the now superseded HTML 4.0 Specification:[/i]
[b][font=monospace]<!ELEMENT SCRIPT - - %Script; -- script statements -->
<!ATTLIST SCRIPT
charset %Charset; #IMPLIED -- char encoding of linked resource --
type %ContentType; #REQUIRED -- content type of script language --
src %URI; #IMPLIED -- URI for an external script --
defer (defer) #IMPLIED -- UA may defer execution of script --
>[/font][/b][/quote]
[i]Originally posted by Charles [/i]
[B]* About one in ten users don't use JavaScript.[/B][/QUOTE]
[i]Originally posted by Charles [/i]
[B]Well, you've been doing it wrong since the spring of 1998. [/B][/QUOTE]
[i]Originally posted by agent_x91 [/i]
[B]if you are unable to use javascript, you're severely limited[/B][/QUOTE]
[i]Originally posted by agent_x91 [/i]
[B]if javascript isn't supported, chances are almost nothing else is.[/b][/quote]
[i]Originally posted by agent_x91 [/i]
[B]there really isn't much you can do with just simple HTML. [/B][/QUOTE]
[i]Originally posted by agent_x91 [/i]
[B]Hey I'm not saying HTML is useless, of course it's necessary for web pages - but HTML alone doesn't get you very far. using HTML without javascript or a similar scripting language is like using a toothbrush without toothpaste [/B][/QUOTE]
[i]Originally posted by Paul Jr [/i]
[B]The point of the web is to deliver content. Why do you need JavaScript, or any other scripting language, to deliver content?[/B][/QUOTE]
[i]Originally posted by agent_x91 [/i]Perhaps your page is chasing away JavaScript free folks so that they don't get counted as your visitors.
[B]well it's never caused any problems for me or any of my pages' viewers so it can't really be called "wrong" [/B][/QUOTE]
[i]Originally posted by Frank1984 [/i]
[B]Is there a language that every browser can read (except for HTML)? [/B][/QUOTE]
[i]Originally posted by agent_x91 [/i]Not so, you should respect that some users don't want or can't enable JavaScript and take that into consideration. I've uploaded a script that does just that, take a look.
[B]go almost anywhere on the web and you see javascript. almost every browser supports javascript. if you are unable to use javascript, you're severely limited and the most you can do for someone is point them to a browser which supports javascript inside the <noscript> tags of your page. [/B][/QUOTE]
[i]Originally posted by agent_x91 [/i]Yes, HTML may be dull and boring, however that's the whole reason that JavaScript exists. JavaScript can be used to add "fluff" to a page, but that's all it should be, fluff. The content that is delivered should not DEPEND on JavaScript.
[B]Sure you don't [B]need[/B] javascript to deliver content, but you certainly need a scripting language of some type to use any sort of special effects. HTML alone is quite simply boring.
maybe im not making myself clear enough. i am not saying that javascript is necessary, i am merely saying that without it, you are limited to basic html formatting, which while is the main building blocks of any website, isn't really very interesting [/B][/QUOTE]
maybe im not making myself clear enough. i am not saying that javascript is necessary, i am merely saying that without it, you are limited to basic html formatting, which while is the main building blocks of any website, isn't really very interesting
[/QUOTE]
[i]Originally posted by llanitedave [/i]If a site is dependent on user interaction then it should employ server-side techniques. There's nothing wrong with using JavaScript to allow user-interaction though, so long as if JavaScript is not supported then users can still access all the content on the site.
[B]If the site is based on and dependent on user interaction, then scripting is probably right.[/B][/QUOTE]
[i]Originally posted by lavalamp [/i]
[B]There's nothing wrong with using JavaScript to allow user-interaction though, so long as if JavaScript is not supported then users can still access all the content on the site. [/B][/QUOTE]
[i]Originally posted by jbot [/i]Write me a blog script using (X)HTML, CSS, JavaScript and SSI's.
[B]using JS and SSI, a site developer can easily cope for all users, disabled or otherwise. ?[/B][/QUOTE]
[i]Originally posted by agent_x91 [/i]As long as what is being discussed is still useful I don't see a problem with it. Saves creating a new thread.
[B]We've all drifted a lil far from the topic... [/B][/QUOTE]
[i]Originally posted by agent_x91 [/i]The problem is that some applications of JavaScript cause harm. If we build public space on the internet but exclude those with disabilities then we hurt those people.
[B]yeah lol, but it's not useful. we all have our own uses for javascript, and it's more useful to some people than others. let's just leave it at that. [/B][/QUOTE]
[i]Originally posted by agent_x91 [/i]It only does the job if it is enabled. If it is not enabled on a users machine and a site depends on the use of JavaScript to function (eg. for navigation), then that user is left high and dry.
[B]There is no incorrect use for javascript - if it does the job, and it does it well, it is fine. [/B][/QUOTE]
[i]Originally posted by lavalamp [/i]
[B]If a site is dependent on user interaction then it should employ server-side techniques. There's nothing wrong with using JavaScript to allow user-interaction though, so long as if JavaScript is not supported then users can still access all the content on the site. [/B][/QUOTE]
0.1.9 — BETA 5.18