This document provides an introduction to JavaScript events through examples. It demonstrates how mouseover and mouseout events can be used to display alerts and change images. It also shows how onclick events can alter background colors and call prompts. The document discusses using the document and window objects to manipulate page elements from JavaScript code embedded in HTML tags.
The Art of AngularJS in 2015 - Angular Summit 2015Matt Raible
Presentation from Angular Summit Keynote in September 2015. http://angularsummit.com/conference/boston/2015/09/session?id=34212
AngularJS is one of today's hottest JavaScript MVC Frameworks. In this session, we'll explore many concepts it brings to the world of client-side development: dependency injection, directives, filters, routing and two-way data binding. We'll also look at its recommended testing tools and build systems.
Presented at SCREENS 2013 in Toronto with Nick Van Weerdenburg
Save 10% off ANY FITC event with discount code 'slideshare'
See our upcoming events at www.fitc.ca
AngularJS is a hot, hot, hot topic. Building web and mobile apps in AngularJS is an ease but there is a learning curve. In this session, you’ll learn the ins and outs of AngularJS and leave the session knowing how to build killer AngularJS apps.
Flash over the years, has been used to prop up the regular browser like a sad old man drinking alone in a pub.
Today browsers come shipped with technology designed to rival flash and aim to shut it squarely out of the game.
Are browser ready to rock without Flash?
PhoneGap Training - Optimus Prime
"More computing sins are committed in the name of efficiency (without necessarily achieving it) than for any other single reason — including blind stupidity."
— W.A. Wulf
МИХАЙЛО БОДНАРЧУК «SuperCharged End to End Testing with CodeceptJS» QADay 2019QADay
Kharkiv Quality Assurance Day 2019
МИХАЙЛО БОДНАРЧУК
«SuperCharged End to End Testing with CodeceptJS»
Телеграм канал: wwww.t.me/goqameetup
Фейсбук сторінці: www.fb.com/goqaevent
Сайт: www.kharkiv.qaday.org/
Spa, isomorphic and back to the server our journey with js @ frontend con po...Alessandro Nadalin
We’ve been toying around with JS since 4 years, trying to figure out what’s the best approach to build mobile-friendly apps that would offer the best performances on mobile devices.
We first went SPA and then decided to take a different approach, as 3 years ago we decided to tackle our problems on mobile with an isomorphic application.
Today, we would like to guide you through years of that choice and why we decided to take a step back and go revamp our mobile website again, with server-side rendering and a pinch of React.
Spoiler alert: 30ms is considered slow.
The Art of AngularJS in 2015 - Angular Summit 2015Matt Raible
Presentation from Angular Summit Keynote in September 2015. http://angularsummit.com/conference/boston/2015/09/session?id=34212
AngularJS is one of today's hottest JavaScript MVC Frameworks. In this session, we'll explore many concepts it brings to the world of client-side development: dependency injection, directives, filters, routing and two-way data binding. We'll also look at its recommended testing tools and build systems.
Presented at SCREENS 2013 in Toronto with Nick Van Weerdenburg
Save 10% off ANY FITC event with discount code 'slideshare'
See our upcoming events at www.fitc.ca
AngularJS is a hot, hot, hot topic. Building web and mobile apps in AngularJS is an ease but there is a learning curve. In this session, you’ll learn the ins and outs of AngularJS and leave the session knowing how to build killer AngularJS apps.
Flash over the years, has been used to prop up the regular browser like a sad old man drinking alone in a pub.
Today browsers come shipped with technology designed to rival flash and aim to shut it squarely out of the game.
Are browser ready to rock without Flash?
PhoneGap Training - Optimus Prime
"More computing sins are committed in the name of efficiency (without necessarily achieving it) than for any other single reason — including blind stupidity."
— W.A. Wulf
МИХАЙЛО БОДНАРЧУК «SuperCharged End to End Testing with CodeceptJS» QADay 2019QADay
Kharkiv Quality Assurance Day 2019
МИХАЙЛО БОДНАРЧУК
«SuperCharged End to End Testing with CodeceptJS»
Телеграм канал: wwww.t.me/goqameetup
Фейсбук сторінці: www.fb.com/goqaevent
Сайт: www.kharkiv.qaday.org/
Spa, isomorphic and back to the server our journey with js @ frontend con po...Alessandro Nadalin
We’ve been toying around with JS since 4 years, trying to figure out what’s the best approach to build mobile-friendly apps that would offer the best performances on mobile devices.
We first went SPA and then decided to take a different approach, as 3 years ago we decided to tackle our problems on mobile with an isomorphic application.
Today, we would like to guide you through years of that choice and why we decided to take a step back and go revamp our mobile website again, with server-side rendering and a pinch of React.
Spoiler alert: 30ms is considered slow.
An overview of web development essentials that will help you as a user experience designer to not only understand how to integrate designs with development components, but also to learn some tips on interacting effectively with developers.
StHack 2014 - Mario "@0x6D6172696F" Heiderich - JSMVCOMFGStHack
There is a way to build common, classic web applications. You know, servers, databases, some HTML and a bit of JavaScript. Ye olde way.
Grandfather still knows. And there is a way to build hip and fancy, modern and light-weight, elastic and scalable client-side web applications. Sometimes with a server in the background, sometimes with a database ? but all the hard work is done by something new: JavaScript Model-View-Controller and templating frameworks.
Angular, Ember and CanJS, Knockout, Handlebars and Underscore? those aren't names of famous wrestlers but modern JavaScript fame-works that offer a boost in performance and productivity by taking care of many things web-app right there in the browser, where the magic happens. And more and more people jump on the bandwagon and implement those frameworks with great success. High time for a stern look from the security perspective, ain't it not?
This talk will show you how those frameworks work, how secure their core is and what kind of security issues spawn from the generous feature cornucopia they offer. Do their authors really know the DOM well enough to enrich it with dozens of abstraction layers? Or did they open a gate straight to JavaScript hell introducing a wide range of new injection bugs and coding worst-practices? Well, you'll know after this talk. You'll know?
JavaScript is one of the 3 languages all web developers must learn:
1. HTML to define the content of web pages
2. CSS to specify the layout of web pages
3. JavaScript to program the behavior of web pages
Downloading jQuery file from jQuery website.
Referring to jQuery file through Content Delivery Networks.
Google CDN
<script src=http://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js>
</script>
Microsoft CDN
<script src=“http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.11.0.min.js”>
</script>
Organizations focus process optimization of
Data Tier
Application Tier
Presentation Tier is usually ignored.
Presentation Tier is responsible for more than 30% of Client/Server application performance.
Science Buddies Staff. (2014, April 21). Follow the Bouncing Ball: A Web Animation Project. Retrieved July 25, 2014 from http://www.sciencebuddies.org/science-fair-projects/project_ideas/CompSci_p012.shtml
Code reviews are vital for ensuring good code quality. They serve as one of our last lines of defense against bugs and subpar code reaching production.
Yet, they often turn into annoying tasks riddled with frustration, hostility, unclear feedback and lack of standards. How can we improve this crucial process?
In this session we will cover:
- The Art of Effective Code Reviews
- Streamlining the Review Process
- Elevating Reviews with Automated Tools
By the end of this presentation, you'll have the knowledge on how to organize and improve your code review proces
Navigating the Metaverse: A Journey into Virtual Evolution"Donna Lenk
Join us for an exploration of the Metaverse's evolution, where innovation meets imagination. Discover new dimensions of virtual events, engage with thought-provoking discussions, and witness the transformative power of digital realms."
OpenMetadata Community Meeting - 5th June 2024OpenMetadata
The OpenMetadata Community Meeting was held on June 5th, 2024. In this meeting, we discussed about the data quality capabilities that are integrated with the Incident Manager, providing a complete solution to handle your data observability needs. Watch the end-to-end demo of the data quality features.
* How to run your own data quality framework
* What is the performance impact of running data quality frameworks
* How to run the test cases in your own ETL pipelines
* How the Incident Manager is integrated
* Get notified with alerts when test cases fail
Watch the meeting recording here - https://www.youtube.com/watch?v=UbNOje0kf6E
May Marketo Masterclass, London MUG May 22 2024.pdfAdele Miller
Can't make Adobe Summit in Vegas? No sweat because the EMEA Marketo Engage Champions are coming to London to share their Summit sessions, insights and more!
This is a MUG with a twist you don't want to miss.
Atelier - Innover avec l’IA Générative et les graphes de connaissancesNeo4j
Atelier - Innover avec l’IA Générative et les graphes de connaissances
Allez au-delà du battage médiatique autour de l’IA et découvrez des techniques pratiques pour utiliser l’IA de manière responsable à travers les données de votre organisation. Explorez comment utiliser les graphes de connaissances pour augmenter la précision, la transparence et la capacité d’explication dans les systèmes d’IA générative. Vous partirez avec une expérience pratique combinant les relations entre les données et les LLM pour apporter du contexte spécifique à votre domaine et améliorer votre raisonnement.
Amenez votre ordinateur portable et nous vous guiderons sur la mise en place de votre propre pile d’IA générative, en vous fournissant des exemples pratiques et codés pour démarrer en quelques minutes.
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...Crescat
Crescat is industry-trusted event management software, built by event professionals for event professionals. Founded in 2017, we have three key products tailored for the live event industry.
Crescat Event for concert promoters and event agencies. Crescat Venue for music venues, conference centers, wedding venues, concert halls and more. And Crescat Festival for festivals, conferences and complex events.
With a wide range of popular features such as event scheduling, shift management, volunteer and crew coordination, artist booking and much more, Crescat is designed for customisation and ease-of-use.
Over 125,000 events have been planned in Crescat and with hundreds of customers of all shapes and sizes, from boutique event agencies through to international concert promoters, Crescat is rigged for success. What's more, we highly value feedback from our users and we are constantly improving our software with updates, new features and improvements.
If you plan events, run a venue or produce festivals and you're looking for ways to make your life easier, then we have a solution for you. Try our software for free or schedule a no-obligation demo with one of our product specialists today at crescat.io
Essentials of Automations: The Art of Triggers and Actions in FMESafe Software
In this second installment of our Essentials of Automations webinar series, we’ll explore the landscape of triggers and actions, guiding you through the nuances of authoring and adapting workspaces for seamless automations. Gain an understanding of the full spectrum of triggers and actions available in FME, empowering you to enhance your workspaces for efficient automation.
We’ll kick things off by showcasing the most commonly used event-based triggers, introducing you to various automation workflows like manual triggers, schedules, directory watchers, and more. Plus, see how these elements play out in real scenarios.
Whether you’re tweaking your current setup or building from the ground up, this session will arm you with the tools and insights needed to transform your FME usage into a powerhouse of productivity. Join us to discover effective strategies that simplify complex processes, enhancing your productivity and transforming your data management practices with FME. Let’s turn complexity into clarity and make your workspaces work wonders!
Need for Speed: Removing speed bumps from your Symfony projects ⚡️Łukasz Chruściel
No one wants their application to drag like a car stuck in the slow lane! Yet it’s all too common to encounter bumpy, pothole-filled solutions that slow the speed of any application. Symfony apps are not an exception.
In this talk, I will take you for a spin around the performance racetrack. We’ll explore common pitfalls - those hidden potholes on your application that can cause unexpected slowdowns. Learn how to spot these performance bumps early, and more importantly, how to navigate around them to keep your application running at top speed.
We will focus in particular on tuning your engine at the application level, making the right adjustments to ensure that your system responds like a well-oiled, high-performance race car.
Launch Your Streaming Platforms in MinutesRoshan Dwivedi
The claim of launching a streaming platform in minutes might be a bit of an exaggeration, but there are services that can significantly streamline the process. Here's a breakdown:
Pros of Speedy Streaming Platform Launch Services:
No coding required: These services often use drag-and-drop interfaces or pre-built templates, eliminating the need for programming knowledge.
Faster setup: Compared to building from scratch, these platforms can get you up and running much quicker.
All-in-one solutions: Many services offer features like content management systems (CMS), video players, and monetization tools, reducing the need for multiple integrations.
Things to Consider:
Limited customization: These platforms may offer less flexibility in design and functionality compared to custom-built solutions.
Scalability: As your audience grows, you might need to upgrade to a more robust platform or encounter limitations with the "quick launch" option.
Features: Carefully evaluate which features are included and if they meet your specific needs (e.g., live streaming, subscription options).
Examples of Services for Launching Streaming Platforms:
Muvi [muvi com]
Uscreen [usencreen tv]
Alternatives to Consider:
Existing Streaming platforms: Platforms like YouTube or Twitch might be suitable for basic streaming needs, though monetization options might be limited.
Custom Development: While more time-consuming, custom development offers the most control and flexibility for your platform.
Overall, launching a streaming platform in minutes might not be entirely realistic, but these services can significantly speed up the process compared to building from scratch. Carefully consider your needs and budget when choosing the best option for you.
Do you want Software for your Business? Visit Deuglo
Deuglo has top Software Developers in India. They are experts in software development and help design and create custom Software solutions.
Deuglo follows seven steps methods for delivering their services to their customers. They called it the Software development life cycle process (SDLC).
Requirement — Collecting the Requirements is the first Phase in the SSLC process.
Feasibility Study — after completing the requirement process they move to the design phase.
Design — in this phase, they start designing the software.
Coding — when designing is completed, the developers start coding for the software.
Testing — in this phase when the coding of the software is done the testing team will start testing.
Installation — after completion of testing, the application opens to the live server and launches!
Maintenance — after completing the software development, customers start using the software.
GraphSummit Paris - The art of the possible with Graph TechnologyNeo4j
Sudhir Hasbe, Chief Product Officer, Neo4j
Join us as we explore breakthrough innovations enabled by interconnected data and AI. Discover firsthand how organizations use relationships in data to uncover contextual insights and solve our most pressing challenges – from optimizing supply chains, detecting fraud, and improving customer experiences to accelerating drug discoveries.
Transform Your Communication with Cloud-Based IVR SolutionsTheSMSPoint
Discover the power of Cloud-Based IVR Solutions to streamline communication processes. Embrace scalability and cost-efficiency while enhancing customer experiences with features like automated call routing and voice recognition. Accessible from anywhere, these solutions integrate seamlessly with existing systems, providing real-time analytics for continuous improvement. Revolutionize your communication strategy today with Cloud-Based IVR Solutions. Learn more at: https://thesmspoint.com/channel/cloud-telephony
Utilocate offers a comprehensive solution for locate ticket management by automating and streamlining the entire process. By integrating with Geospatial Information Systems (GIS), it provides accurate mapping and visualization of utility locations, enhancing decision-making and reducing the risk of errors. The system's advanced data analytics tools help identify trends, predict potential issues, and optimize resource allocation, making the locate ticket management process smarter and more efficient. Additionally, automated ticket management ensures consistency and reduces human error, while real-time notifications keep all relevant personnel informed and ready to respond promptly.
The system's ability to streamline workflows and automate ticket routing significantly reduces the time taken to process each ticket, making the process faster and more efficient. Mobile access allows field technicians to update ticket information on the go, ensuring that the latest information is always available and accelerating the locate process. Overall, Utilocate not only enhances the efficiency and accuracy of locate ticket management but also improves safety by minimizing the risk of utility damage through precise and timely locates.
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI AppGoogle
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
👉👉 Click Here To Get More Info 👇👇
https://sumonreview.com/ai-fusion-buddy-review
AI Fusion Buddy Review: Key Features
✅Create Stunning AI App Suite Fully Powered By Google's Latest AI technology, Gemini
✅Use Gemini to Build high-converting Converting Sales Video Scripts, ad copies, Trending Articles, blogs, etc.100% unique!
✅Create Ultra-HD graphics with a single keyword or phrase that commands 10x eyeballs!
✅Fully automated AI articles bulk generation!
✅Auto-post or schedule stunning AI content across all your accounts at once—WordPress, Facebook, LinkedIn, Blogger, and more.
✅With one keyword or URL, generate complete websites, landing pages, and more…
✅Automatically create & sell AI content, graphics, websites, landing pages, & all that gets you paid non-stop 24*7.
✅Pre-built High-Converting 100+ website Templates and 2000+ graphic templates logos, banners, and thumbnail images in Trending Niches.
✅Say goodbye to wasting time logging into multiple Chat GPT & AI Apps once & for all!
✅Save over $5000 per year and kick out dependency on third parties completely!
✅Brand New App: Not available anywhere else!
✅ Beginner-friendly!
✅ZERO upfront cost or any extra expenses
✅Risk-Free: 30-Day Money-Back Guarantee!
✅Commercial License included!
See My Other Reviews Article:
(1) AI Genie Review: https://sumonreview.com/ai-genie-review
(2) SocioWave Review: https://sumonreview.com/sociowave-review
(3) AI Partner & Profit Review: https://sumonreview.com/ai-partner-profit-review
(4) AI Ebook Suite Review: https://sumonreview.com/ai-ebook-suite-review
#AIFusionBuddyReview,
#AIFusionBuddyFeatures,
#AIFusionBuddyPricing,
#AIFusionBuddyProsandCons,
#AIFusionBuddyTutorial,
#AIFusionBuddyUserExperience
#AIFusionBuddyforBeginners,
#AIFusionBuddyBenefits,
#AIFusionBuddyComparison,
#AIFusionBuddyInstallation,
#AIFusionBuddyRefundPolicy,
#AIFusionBuddyDemo,
#AIFusionBuddyMaintenanceFees,
#AIFusionBuddyNewbieFriendly,
#WhatIsAIFusionBuddy?,
#HowDoesAIFusionBuddyWorks
2. Cautions!
• JavaScript is very case sensitive
• JavaScript should have each command
written on one line
• To be able to see source code effectively, I
use Explorer
4. <HTML>
<HEAD>
<TITLE>Rollover</TITLE>
</HEAD>
<BODY>
<P ALIGN=RIGHT>
<A HREF="#" onMouseOver = "alert('Testing mouse over!');">
<FONT SIZE=12>Mouse over here!</FONT></A></P>
Some of the first interesting things you can do with JavaScript are event-driven. Event
driven means that a particular action causes something to happen. JavaScript has licks that
can detect events such as onClick, onMouseOver, onMouseOut. This page illustrates the
mouse over and mouse out events.<BR><BR><BR>
<A HREF="#"
onMouseOver="document.CISimage.src='CISa.gif';"
onMouseOut="document.CISimage.src='CISb.gif';">
<IMG SRC="CISa.gif" NAME="CISimage"></A>
<BR><BR>
In this case, the onMouseOver
will bring up an alert message
box . Note the use of quotes, the
semicolon and the parenthesis
which go with the alert()
function.
# in the A HREF
means same page.
CISaCISb.htmlCISaCISb.html
In this example onMouseOver
shows one image and onMouseOut
shows a different image. Note that
CISimage is the name associated
with the image that shows when
the code is loaded. Again, note the
use on quotation makes and semi-
colons and the < > in the HTML
surrounding the JavaScript.
5. CISaCISb.htmlCISaCISb.html
Notice that the # means this page to HTML and so setting the HREF to the # means stay on the same page. You can
also use the name of the current page.<BR> Now looking at the construction of the command. Note that
onMouseOver should be written exactly that way because of case sensitivity issues. In the first example, I am saying
the mouse roles over the words Mouse over here!, then the alert box will come up with the message that says Testing
mouse over. Notice the use of the double quote, single quotes, parenthesis and semi-colon. Inside the double quotes
is the JavaScript comman which should end with a semi-colon. What we are doing is putting the JavaScript inside
the
quotes of an event. The event is onMouseOver. The alert needs a message and the message inside parenthesis and
enclosed in single quotes. If you have quotes within quotes the inner quotes must be single to differentiate. The
alert() function puts the message in the () inside the message box. Note that all functions in JavaScript have the form
functionName() where sometimes the parenthesis contain data and sometimes they are empty. We will see more of
this in later examples. Note one last thing that has nothing to do with JavaScript, because I wanted to Mouse over
here! to be large and aligned to the right, I used the paragraph to align to the right and the font to change the font.
These are not needed for the JavaScript.<BR>
On the next example, I am using both onMouseOver and onMouseOut. I went into PhotoEditor and did a invert with
the CISa.gif image and saved it as CISb.gif. Then I can have one image show when the mouse rolls over the image
and a second image show when the mouse rolls out.<BR>
When I work with an image, I need to be aware of the fact that frequently browers will not let the developer put
events inside image tags. So what you have to do is set up the HREF equal to # and put the events inside that and
then set up the image source with name as shown above. When the image is firstloaded it will show the image in
IMG SRC which in this case is CISa.gif. When the mouse goes over that same image is shown. When the mouse
goes out a different image is shown (in this case the inverted image). The dots in document.CISimage.src have
special meaning to JavaScript. It will go to the last dot and work backward in the interpretation. So this essentially
reads as change the src of CISimage which is in the document. This follows a document object model hierarchy
(DOM) which can be referenced in many tutorials on JavaScript.<BR> To make things more efficient you can
preload the images. I will illustrate a preload in another example.<BR>
One other thing to note - because single and double quotes have special meanings, you cannot use them in the
ordinary way in your text. If you want to use the quotes in your text you do it with Jane's where the tells JavaScript
to use the single quote instead of interpreting it.
7. <HTML>
<HEAD>
<TITLE>More events in JavaScript</TITLE>
<SCRIPT language="JavaScript">
var CISa_image = new Image();
CISa_image.src = "CISa.gif";
var CISb_image = new Image();
CISb_image.src = "CISb.gif";
</SCRIPT>
The word var is optional - however if used it should be lower case.
When I write this program with VAR I get an error in explorer about missing ; which
essentially means their is a problem with the code.
</HEAD>
<BODY>
The code above preloads two images.<BR>
<A HREF="#"
onMouseOver="CISimage.src='CISa.gif';"
onMouseOut="CISimage.src='CISb.gif';">
<IMG SRC="CISb.gif" NAME="CISimage" BORDER = 0></A>
</BODY>
</HTML>
CISaCISb1.htmlCISaCISb1.html
Load the images. The
variable name where they
are put are CISa_image and
CISb_image.
This time the CISb.gif is
loaded when the form is shown.
In this example I am simply giving
the image name.
8.
9. <HTML>
<HEAD>
<TITLE>Java rotate</TITLE>
<SCRIPT>
originalz = new Image;
originalz.src="house.jpg";
flipz = new Image;
flipz.src = "houseusd.jpg";
</SCRIPT>
</HEAD>
<BODY bgcolor=beige>
<DIV ALIGN=CENTER>
<H1>Here is an image to roll the mouse over</H1>
<H3>Rolling the mouse over and out are called events.</H3>
<A HREF="javamouse.html"
onMouseOver="document.myhouse.src = flipz.src"
onMouseOut="document.myhouse.src = originalz.src">
<IMG SRC="house.jpg"
NAME="myhouse"></A>
</DIV>
</BODY>
</HTML>
javamouse.htmljavamouse.html
This code establishes a new Image called
originalz and then specifies the source for this
image as house.jpg.
It then establishes another new image called flipz
and then specifies that the source for this image is
houseusd.jpg.
The events are associated with the A HREF which refers
to this page. The events say take the current document or
window and then the name associated with the image and
make the source the sources that were specified in the
<HEAD>.
This means
the original
image shown
is house.jpg
Document refers to the
object of the window that is
being worked with.
Note I
used
the
defined
image
name
and not
the .jpg
name.
10. <HTML>
<HEAD>
<TITLE>Java rotate</TITLE>
<SCRIPT language = "JavaScript">
<!--hide from browser that do not support
var originalz = new Image;
originalz.src="house.jpg";
var flipz = new Image;
flipz.src = "houseusd.jpg";
// end of the hide -->
</SCRIPT>
</HEAD>
<BODY bgcolor=beige>
<DIV ALIGN=CENTER>
<H1>Here is an image to roll the mouse over</H1>
<H3>Rolling the mouse over and out are called events.</H3>
<A HREF="javamouse.html"
onMouseOver="document.myhouse.src = flipz.src;"
onMouseOut="document.myhouse.src = originalz.src;">
<IMG SRC="house.jpg"
NAME="myhouse"></A>
</DIV>
Here are a few comments on the program.
<UL>
<LI>I did not include langauge = "JavaScript" in
the SCRIPT of the original program because it is not required. It is a good thing to do
because other languages can be used for scripting, such as VB.
<LI>This code includes the Hide me if the browser does not support JavaScript code.
<LI>var is not required so I did not use it in the previous example.
<LI>the semi-colons are not required after the mouse over and out and I did not use them
in the previous example
</BODY>
</HTML>
11.
12. <HTML>
<HEAD>
<TITLE>Events in Java</TITLE>
</HEAD>
<BODY bgcolor=aqua>
<H3>Events are a different type of Java code because they are built directly into the HTML code.
They aren't scripts because their design was to be embedded in the HTML. First I am
going to illustrate mouse over/out events.</H3>
<P ALIGN=CENTER>
<A HREF="tryevent1.html"
onMouseOver="alert('Testing events...')">ALERT MOUSE TEST!</A>
<BR><BR>
<A HREF="tryevent1.html"
onMouseOver="document.bgColor='beige'">CHANGE BACKGROUND TO BEIGE!</A>
<BR><BR>
<A HREF="tryevent1.html"
onMouseOver="document.bgColor='aqua'">CHANGE BACKGROUND TO AQUA!</A>
<BR><BR>
<A HREF="tryevent1.html"
onMouseOver="document.bgColor='pink'"
onMouseOut="document.bgColor='green'">CHANGE BACKGROUND!</A>
<BR><BR>
<A HREF="tryevent1.html"
onMouseOver="window.status='Testing roll over'; return true"
onMouseOut="window.status='Testing roll out'; return true">WINDOW STATUS TRUE TEST!</A>
<BR><BR>
<A HREF="tryevent1.html"
onMouseOver="window.status='Testing roll over'"
onMouseOut="window.status='Testing roll out'">WINDOW STATUS TEST!</A>
<BR><BR>
Note: The return true clause allows the default in the window status to be over ridden.
</P>
</BODY>
</HTML>
tryevent1.htmltryevent1.html
Different things are happening as a result of the onMouseOver
event. In the first example, a popup alert window comes up. In
the second the background changes to beige.
14. <A HREF="tryevent1.html"
onMouseOver="document.bgColor='beige'">CHANGE BACKGROUND TO BEIGE!</A>
This shows the results of running
the mouse over CHANGE
BACKGROUND TO BEIGE!
The code is shown below.
Note that “document.bgcolor=‘beige’” is enclosed in double quotes
and the word ‘beige’ is enclosed in single quotes because it is
embedded in double quotes and trying to use double quotes would
confuse the structure of the command.
19. <HTML>
<HEAD>
<TITLE>Events in Java</TITLE>
</HEAD>
<BODY bgcolor=pink onLoad="alert('WELCOME!')">
<H3>This example illustrates the on click event.</H3>
<P ALIGN=CENTER>
<A HREF="tryevent2.html"
onClick="alert('Testing events...')">ALERT ON CLICK TEST!</A>
<BR><BR>
</P>
<H3>Using onFocus, when you click on the box in the form, the window will display the
activity to be done.</H3>
<H3>Using onChange tells when the data has been changed.</H3>
<FORM NAME="crsform">
Course information:
<INPUT TYPE="text" SIZE=5 NAME="crscode"
onFocus="window.status='Enter course code'">
<INPUT TYPE="text" SIZE=25 NAME="crsname"
onFocus="window.status='Enter course name'";
onChange="alert('The data has been changed')";>
<BR><BR>
<P>MAJOR:<BR>
<INPUT TYPE="RADIO" NAME="major" VALUE="CI">Computer Information Systems<BR>
<INPUT TYPE="RADIO" NAME="major" VALUE="BU">Business Administration<BR>
<INPUT TYPE="RADIO" NAME="major" VALUE="other">Other major<BR>
<H3>The onBlur means that you have lost focus on an answer.</H3>
<INPUT TYPE="text" SIZE=25 NAME="crsinst"
onFocus="window.status='Enter instructor name'";
onBlur="alert('Did you enter instructor name?')";>
<P>Comments:<BR>
<TEXTAREA ROWS="6" COLS="40" NAME="Comments"></TEXTAREA>
<P>
<INPUT TYPE="RESET" VALUE="Clear">
<P>
<INPUT TYPE="BUTTON" VALUE="Back" onClick="history.go(-1)">
<INPUT TYPE="BUTTON" VALUE="Forward" onClick="history.go(1)">
</FORM>
</BODY>
</HTML>
tryevent2.htmltryevent2.html
25. <HTML>
<HEAD>
<TITLE>More events</TITLE>
<SCRIPT language="JavaScript">
var mycolor;
var myfont;
</SCRIPT>
</HEAD>
<BODY>
<H2>This shows some uses of the onClick event</H2>
<IMG SRC="CISa.gif" NAME="originalz"><BR>
<A HREF = "#"
onClick="window.document.bgColor='beige'";>Make background beige</A><BR>
<A HREF = "#"
onClick="window.document.fgColor='blue'";>Make font blue</A><BR>
<A HREF="#"
onClick="mycolor=prompt('Enter your choice of background color','');
window.document.bgColor=mycolor;">Change the background color</A><BR>
<A HREF="#"
onClick="myfont=prompt('Enter your choice of font color','');
window.document.fgColor=myfont;">Change the font color</A><BR>
<A HREF="#"
onClick="document.originalz.src='CISb.gif';">Click here to change the top image!</A><BR>
<A HREF="#"
onClick="document.originalz.src='CISa.gif';
return false;">Click here to change the top image back!</A><BR>
onClick.htmlonClick.html
The prompt calls for title, data for
the input box. In the first case, I
want nothing in the input box. In the
second case I am using a default of
pink. This is shown on the next
page.
26. Note: Return false is another way to tell the browser not to follow the link given.<BR>
The Prompt puts up a box where the user can enter input. Note that in the prompt I have
some words that will become the title, then I entered a comma and two quotes together. The
two quotes together make the box where I want the user to enter information blank. If
I wanted to put a default in the user entry line I could put in between the quotes.<BR>
<A HREF="#"
onClick="mycolor=prompt('Enter your choice of background color','pink');
window.document.bgColor=mycolor;">Change the background color</A><BR>
Note also that there are two things that I want to do on the click event, one is to get
the user to pick a color or in this case, go with the default. The other is to use that
color to change the background. The double quotes are around both of these.
</BODY>
</HTML>
onClick.htmlonClick.html
27.
28. <HTML>
<HEAD>
<TITLE>Javascript font experiment</TITLE>
</HEAD>
<BODY BGCOLOR=beige>
This is an experiment with Javascript and font useage. Note that in javascript terms, the
document is an object and the write statement that I am going to include below is a method
or in other words an action that is executed on the document. When I do the write below,
color and the size are being done to the document at a particular time and this is an instance.
Objects can also have properties related to them as shown in the example after dealing
with fonts.
<BR><BR>
<SCRIPT LANGUAGE="javascript">
document.write("<FONT COLOR='GREEN' SIZE=150%>This is green font</FONT>")
</SCRIPT>
<BR><BR>
Now I am going to try this without the double quotes around the whole. You can see that this
doesn't work. Essentially the material inside the double quotes will be written to the screen
and the HTML code that is included will be executed. Notice that the attempt to get red font
below does not work because the double quotes around FONT are missing.
<BR><BR>
<SCRIPT LANGUAGE="javascript">
document.write(<FONT COLOR="RED" SIZE=150%>This is red font</FONT>)
</SCRIPT>
Note also since I am using double quotes outside. I need to use single quotes or no quotes
inside for the color.
<BR><BR>
<SCRIPT LANGUAGE="javascript">
document.write("<FONT COLOR=BLUE SIZE=150%>This is blue font</FONT>")
</SCRIPT>
Font1.htmlFont1.html
Editor's Notes
In this presentation, we will focus on events. The next presentation will cover more of the actual scripting.
Please read some notes on JavaScript. For today, focus on some of the rules involved and on the use of events.
Be sure to read about the concepts of objects, methods, objects and events to help you understand the code.
This is an example of mouse over using text and using an image box.
This shows the actual code using the onMouseOver and onMouseOut.
This shows some explanatory notes that are included in the code.
This shows the results of the next page, CISaCISb1.html.
This shows the code with the preload of the images done in JavaScript in the header.
Note that with things other than events, JavaScript is enclosed in the SCRIPT shown. It is better to include the clause language = &quot;JavaScript&quot; since ther are other scripting languages.
In the previous example instead of CISimage I used document.CISimage. I could also have used window.document.CISimage.
This is the program called javamouse.html. Rolling the mouse over the picture causes it to appear up side down. This is because there are two images. In a graphics package I saved the image, then rotated it 180 degrees and saved it again under a different name.
In the SCRIPT in &lt;HEAD&gt; I establish the two images and name them originalz and flips. Establishing the images in the &lt;HEAD&gt; means that they will be loaded initially and there will not be a delay in the mouse over and mouse out events.
Please read an explanation of this click event in one of the many tutorials and fact sheets available on the Web. The explanation here needs to be elaborated on.
Note that in this example, I used the name defined in the script for the image instead of the actual .jpg name. In previous examples I used the actual image name enclosed in quotes.
This version is a little more &quot;professionally done&quot;.
This is try event one. It experiments with other uses of the mouse over and mouse off. The code is on the next page.
I got this code by opening source in Explorer 5.0 which shows the JavaScript.
Again we are referring to document as the object and in this case bgColor is a property of the document object.
Note that in JavaScript the syntax is:
Event=&quot;document.property or method&quot;
If you need quotes within the quotes, the inner quotes are done with single quotes.
In the case of alert we are talking about a different object - a popup alert window that comes up and in the case of window.status we are talking about the object window and the status of that window.
This slide shows the alert which brings up the alert popup window which displays the message inside the parenthesis.
Read about the use of quotes in JavaScript in one of the tutorials.
Note the Testing roll over in the window status.
return true &quot;locks&quot; the message into the status line so it won&apos;t be replaced by the default URL.
Compare this to the next set which does not have the return true.
Without return true, the default URL appears.
In this example, the BODY statement has an onLoad event which displays the alert window when the page is opened.
The code for tryevent2.html.
This causes Enter course code to show on the status line when the focus is on the first box after Course information.
When the course name got the focus, the message appeared on the status line. When I left the course name (NAME=&quot;crsnmae&quot;) then the alert window appeared.
When I left the instructor box (NAME=&quot;crsinst&quot;) the onBlur was activated and the alert popup message appeared.
history.go(-1) moves back one screen
history.go(1) moves forward one screen
Different numbers can be used to control where you go.
This shows a page with a variety of onClick options. You can change background color, default font color, or the image and you can get user input on the colors to use.
This shows the onClick code. Note that the prompt asks for user input.
Note that bgColor is background color and fgColor is the default font color - I assume fg means foreground color.
As mentioned on the previous page. This prompt will ask for a choice of color and give the default of pink.
This shows font1.html. Note that font2.html is cleaned up a little and it is missing the purposeful error on this slide. You should look at the code for both.
This is illustrating the use of the document.write() with a variety of different options. Please look at font1.html and font2.html.