If And Else - Display A Message Saying Good Morning If It Is In The Morning - Good Afternoon If It Is In The Afternoon
May 31, 2011
6. Display a message saying Good Morning if it is in the morning, Good Afternoon if it is in the afternoon, and Good Evening if it is in the Evening. This is my code:
I've got a page with DB data displayed, and a link beside each record to update the corresponding record. When the update icon is clicked, a popup with the data comes up, once the user is finished updating, when they click submit, I have the following code:
<input type="button" onClick="opener.location.reload(); self.close()" value="Refresh and close">
My problem with this is that it refreshed the parent too quickly for the data to have made it's way to the DB, since it requires a manual refresh once the child has closed to properly display the updated data.
Are there any good web UI component libraries -open source or commercial - that you can recomment? They need to be cross browser compatible and have good documentation. Jquery UI is very good but limited in number of controls it offers. YUI is very verbose and very hard to use. extJs only other one I can think of. Any others you use and like?
At present I am reading Javascript for Dummies, no-one tut please! Can anyone suggest a good beginners book for javascript that is easy to understand but allows progression from nothing to competent (graphics welcome); which includes everything.
I got a simple rollover with a little twist to it… and I have a little glitch.
The two only images that I am trying to get to swap are:
Button_on.jpg Button_off.gif
That’s it. And it’s the same images for all 5 links
This means that …
all 5 links should start with button_off.gif. And any of the 5 links should swap to button_on.jpg when I get my mouse over it--while all others remain with button_off.gif.
The rollover works, but the only image that swap is on link #5. That is whether I bring my mouse to link #1 or link#2 or any other link. The only image that keeps swapping is link #5.
Check it out and try moving your pointer over the links and you’ll understand
MY TEMPLATE
Afterward, I’ll add text links above these rollovers using CSS. PS: is there a way to create a similar effect using CSS?
I want to know what is the best Javascript editor for Windows, that have a good syntax highlighting, IntelliSense(it's that technology of the menu when typing, like on Eclipse, but I can't remember it's correct name) and a class browser, what is very useful when you want to see the names of your classes and functions, also to browse on then.
I am a complete beginner to JavaScript (well I know this: document.write and alert) and I kneed a really good tutorial for beginners. Preferably free but I will pay up to �3 (not a lot I know but oh well)
I'm looking for 5-radio button replacement. The user should be able to slide a slider between values from 0 to a 100. Text will appear under it that will say "I strongly agree" "I agree somewhat" "I am indifferent" "I disagree" "I strongly disagree" depending on the values of the slider (they should change in real-time). Unfortunately I do not have the skill to make one, especially one that has a good browser-compatibility. Does anyone know any good snippets? I'll keep searching on google and post back if I find one.
I am writing an application that (unfortunately) will work only with certain browsers and operating systems. Does anyone have a link to a good "browser/OS detection script"?
I'm looking for something simple that I can just include in each page of my html code, and us it like this:
I have still yet to see a JavaScript Editor that comes close toreading a good JS book, learing it and using it with a text editor.
Anyway, here my recipe for build successfull DHTML Applications:
If you want to support only M$ IE stop here and do the following: 1) Install blindfold 2) Repeat the phrase - I love my cage :p
Buy the Book: Buy O'Reilly's JavaScript The Definitive Guide ~ The best damn JS guide & reference period, end of story, finito
Get a good Text Editor with Syntax Highlighting support ~ Real programmers don't use WYSIWYG tools ~ You will never learn with these tools ~ Code is always inefficient ~ Apps to Use: ~ OSX - BBEdit - Powerful but no MDI support :( ~ Win32 - UltraEdit - Low cost, high power, competent yntax Highlighting ~ ^nix - Kate or KDevelop - Well written but needs KDE (big) ~ Does not work with OSX's X11 Client :[ - ('+' key doesn't work)
Browser Development Platform ~ Mozilla (1.3+) (FireFox release suggested) ~ Why Moz? ~ Mozilla based development works in: ~ IE 95% of the time ~ Konquorer (KDE/Apple...), Opera 99%+ of the time ~ Why not IE? ~ IE based development works in standards based browsers only 50% of the time ~ IE black hole methods (non standards based) causes people to ignore standards based DHTML objects, properties and methods. ~ Browser Support Baseline ~ IE 5.5sp2+ ~ This is the first (reasonably) stable version of IE for advanced JS coding. ~ When ever I experience weird bugs from users I have them them upgrade to IE5.5sp2+ and it goes away. ~ Netscape 6.n+ ~ Netscape 4.7 should not be supported! ~ Opera ? (I plead ignorance here) ~ Konquorer/Safari ? (I plead ignorance here)
Debugging Methodology: ~ Use JS Console (Moz) ~ Put try/catches at all error prone functions / methods ~ Because of IE's error stupidity, you should get as close to the source as possible. ~ Read stack property of error in Mozilla to read stack of error (powerful) ~ Install JavaScript Console Status in Mozilla ~ Use window.onerror handler ~ In IE, read arguments.callee.caller... to read stack ~ Goes only to last error throw point ! not error source point :[ ~ Note: at this time, there is no way to to get to the Error object in Mozilla from this handler. Therefore no stack in Moz. Use Try/Catch instead
Add the following code to every page: _w=window function getElem(s){return document.getElementById(s)} function getEvent(e){ return is.ie?_w.event:e }
Event Declaration ~ Avoid using inline javascript declarations (In HTML Tags) ~ Inline declarations is where you call a function or run code from the html elements definition (onclick="<RunSomeCode>") ~ This technique will not allow you to access the event argument in Mozilla... ~ Instead use getElem("<Element ID>").onclick=<function name> ~ Declare handlers like: function mySlickFunction(e){e=getEvent(e)... ~ This will ensure you always have Event Object ~ If you want to get fancy you could normalize the Event at getEvent() ~ Method Declaration ~ Declare <obj>.<meth>=function <obj_acro>_<event>(args){ ~ Example: myObj.smile=function MO_smile(args){... ~ Why? - When you build you're stack in the debug you get the method names!
Other Stuff: ~ Use JSON (www.json.org) as much as possible to nest data structures (for more complex programming). ~ JSON is fast (primitively supported), stable easy to read.
Could anybody else add to this list?
If people are interested, I can make a document and add other stuff like JS debugging libraries, Consoles and other slick JS Debugging stuff.
I'm looking for a good JavaScript based horizontal/drop down menu that's free and works down to IE6. The Yahoo! YUI menus would probably do the trick, but seem like a bitch to understand & customize.
Any easier & more accessible options? That are rock-solid professional grade?
Can anyone recommend a good javascript drop-down menu?
I am searching for one with these features: - can easily be used for horizontal and vertical menus; - is search engine friendly (not mandatory); - resizes properly when increasing/decreasing browser text sizes;
There are so many choices, and so little time, so if you know of any great ones that are free or affordable, please let me know.
The jQuery library is definitely very useful for those who have development background experiences but don't have the time to learn Javascript in it's true nature. I've played with it on and off, on a few smaller sites I manage, and the outcome was truly amazing. I don't know Javascript at all, aside from the basics and I was able to create a very fun and fast UI very quickly for my visitors. I wonder though; Does the jQuery library hold up efficiency for larger sites?
I currently manage a site with over 1.6 million post, averaging around 15,000 post per day this month. With me not having the time to really learn Javascript and I don't have much of a budget to hire someone to do the work I want yet, it would seem logical to use jQuery if I already know how to use it, right? I just worry, with the growth rate for the site at it's all time high, I'm afraid that jQuery will do more bad then good.
Are there any high traffic sites successfully using jQuery that you know about? has anyone experimented with jQuery on their high traffic sites? Would it seems more sensible to hire someone to do the Javascript work?