In my course on website design we just started some JavaScript. In the very first assignment nothing shows in my browser. I have two questions:
Is there a way to get it to show in my browser so I can complete the assignment?
Is JavaScript widely unviewable? Here is the script I used:
<script language="JavaScript">
<!Hide from non-JavaScript browsers
document.write("Today is 12/15/2003<br>");
document.write("Only 10 days until Christmas");
//Stop hiding -->
</script>
My problem is : I have an image file located on the client machine in the 'd:imageemp1.jpg' I want to make a function that accepts the image filename -"d:imageemp1.jpg" as a parameter and display the image in anew page in the browser.
I am using Javascript: pop up function to pop up bar chart on a new page to show the pointer of the student. My JS codes can run on IE and firefox but fail on chrome. Chrome give me the blank chart as shown below.
I want to display the same thing as in IE and firefox in chrome as well. Below are the codes:
Since the code is triggered ever onclick event it may be resource hungry on large pages.
I guess desired upgrades to suit it more for general purpose and reuse would be:
1> Replace document.write with a way of altering the CSS class rule property. Hard part on this after reading quirksmode would be in targeting the CSS rule in a cross browser, not to intensive way.
2> Find a better cross browser trigger attachment than the current firing on every click.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Spinner Test</title> <style type="text/css"> <!-- .spinnerContainer {} .spinnerLink {cursor: pointer;} .spinnerContent {display: block;} --> </style> <script language="JavaScript" type="text/JavaScript"> document.onclick=function(evt){ //Credit to Beagle and coding forums http://www.codingforums.com/showthread.php?t=90062 if(!evt){evt=window.event;} // *** IE fix *** var spinner;// *** element that got clicked *** // *** Credit to PPK from quirksmode.org for this block *** if(evt.target){spinner=evt.target;} else if(evt.srcElement){spinner=evt.srcElement;} if(spinner.nodeType==3){spinner=spinner.parentNode;} // defeat Safari bug if(spinner.className=='spinnerLink'){ var contentDiv=spinner.nextSibling; if(contentDiv.nodeType==3){contentDiv=contentDiv.nextSibling;} //Action if(contentDiv.style.display!='block'){contentDiv.style.display='block'}else{contentDiv.style.displa y='none'} }//from: if(spinner.className=='spinnerLink'){ }//from: document.onclick=function(evt){
For a site I will be working on, It will require people to upload large files. We don't want the users to think that nothing is happening, so we would like to be able to show a progress meter of the progress of the upload.
The file will be submitted through a normal form on a page (or any other way possible through the browser). Is there a javascript progress bar I could use for this purpose?
I'm using the scroll function with a layer containing a graphic that sits over the slider on the y axis. This works fine in IE but overhangs the lower scrollbar arrow in Netscape, Firefox and Opera, killing its functionality, so I'd like to hide it in these browsers.
Could someone show me the best way to work a function that says (taking the layer ID as 'Bar')
I have some html code i would like to be printed to the page only if the browser has javascript enabled. I have tried to use document.writeln() but the string i want to print bot contains some ' and " in it. I don't know how to set the delimiters of the string that is passed as argument so that i don't get an error in the page.
I want the list of browser which is not supporting Java Script. So far I am thinking only JavaScript is the standard scripting language supports in most the browser. Is any scripting language supports in all browsers.
how do i know if a browser supports javascript or not ? I implemented some javascript on my site, but noticed that some browsers do not support our scripts. i am using IE 5.0 now on another system, and it doesnt seem to work.
I've been playing with some javascript code and have produced a very rough proof of concept source code editor written in javascript (a bit like FCKeditor). Its not ready for release ((L)GPL>2 when it is) but I thought I'd ask for any guidance and tips.
The intention is to provide a language nuetral source code editor writen purely in html and javascript so that it can provide code highlighting/completion etc, eventually as part of an ajax(ish) IDE so with fckeditor you can manage web sites completely remotely. There is a temptation to try and use mozilla/venkman but I'd like it to run on small handhelds too so I will stick to writing it in pure Javascript/Html.
The intial plan is to produce a javascript editor and then a stylesheet editor (using the CSS editor on Firefox may make this a low priority) but I'd like it to be configurable for any language so almost any coding can be done over the web.
Anybody know any examples of similar that I could plagiarise to get the basic architecture right?
I have some very strange problem on the Mac (OS-X) with the Safari browser 1.0 (v85). Some information in my form was not filled in... after I turned on debugging and checked the console it displayed some error messages.
The messages displayed were like:
(event handler): value undefined (result of expression trim) is not object. Cannot be called.
I have no idea what this means!!! Does anyone know where to find the solution for this problem? The page works fine on Windows with IE (and probably some more browsers).
The trim function is located in an exteral javascript file which is referenced in the head of the html. Code:
I have to access a website which does a stupid browser check and only accepts Netscape 4.7. The problem is that I have to access the website with Mozilla or Internet Explorer. Code:
Now, I am not talking about some kind of malicious coding, or spyware writing by any means, but I do need it to be able to read the cookies from a site other than my own. At least I think this is what is required. What I am trying to accomplish is this; I have a stats package setup on a different domain than my live website and I am using it to track the stats of the users on my site other than paying for stats service through some other company, and it seems to be working just as I need it to, only I would like for it to be able to do a little bit more. Right now, all it is capturing form the user is their IP address, browser information and host information on their ISP. But, I would like for it to be able do more. I would like for it to be able to retrieve certain cookies generated by a different site and show me the information in which the cookies hold... I am not talking about displaying passwords or any such thing like that, I just need certain information.
Is there a way to detect with javascript the height and width of a browser window that's open? Much the opposite of a pop-up where you define the height and width I guess you could say - anyone know if this is easily possible?
I am currently working on an internal browser based application for my company and I would like to remove the toolbar from the Browser window.
The JSP screens have a typical header, body and footer structure. I have tried putting in a javascript in the header that blocks the back button but it seems to only work on some of the screens. What I would like to do is just remove the whole toolbar tp prevent anymore problems. Unfortunately the Users want keep the address bar and they do not want to have the application pop-up in a new window after they login.
Is there any way that I can have the toolbar disappear after the User logs in and goes to the next screen?
I'm building the "Contact Us" section of my .mobi site (xhtml and html).Is there any way to create an e-mail form that use the mini-browser built-in mailer? (Perhaps a javascript code to add ?)
I have seen this employed somewhere else, but for the life of me cannot remember how it was done. I need to write a javascript that will call a desired CSS file based on the user's browser.
I'm developing a site that will use technologies like JavaScript and AJAX. I want the site to be functional for people that has older browsers or JavaScript turned off so for this I need to find out if the user's browser is supporting JavaScript and AJAX.
How can I check this in an easy and simple way? I.e the user enters my website with JavaScript turned off at the moment. And then he turns it on and reloads the page. I would like to catch that he has turned JavaScript on. The same goes with AJAX (although there is no off/on setting for AJAX).