Showing posts with label JAva Script. Show all posts
Showing posts with label JAva Script. Show all posts

Tuesday, June 26, 2012

Canvas vs. SVG


ShareThis

Canvas vs. SVG
With the advent of Canvas and SVG (scalable vector graphics), developers now have better choices for doing graphics on the Web than in the past.

Before Canvas, plug-ins such as Flash or Silverlight were the standard way to create animations on the Web. The alternative was to create a collection of good old-fashioned HTML, JavaScript and images, and bundle them into a collection of moving parts—a tedious task at best.

Two primary types of graphics are used on the Web:
·         Raster graphics are arrays of pixels arranged on a grid, also known as a bitmap. Common raster file extensions are .jpg, .bmp, .png, .tiff and .psd. Because Canvas uses pixels, it is raster based.
·         Vector graphics use mathematical metadata contained in a file to describe the graphic. The V in SVG stands for vector. Common vector file types are .svg, .eps and .xps.
Canvas and SVG have a few features in common. Both Canvas and SVG have an Open Source library ecosystem, and you never need plug-ins for either technology.

Side-by-side comparison of common Canvas and SVG characteristics.
Canvas
SVG
Single DOM element
Multiple DOM elements
Script language
Markup language
Raster graphics
Vector graphics
No file format
.svg file format
Must reset canvas to change drawn shape
Can edit shapes after drawing
Not accessible
Accessible
Doesn’t support event handlers
Supports event handlers
Non-searchable, can’t index
Searchable, can index
Non-compressible
Compressible
Can use hardware acceleration
No hardware acceleration

Canvas tends to be well suited for highly interactive games, especially when combined with Internet Explorer 9 GPU offloading.
Canvas is a great choice for image editing, and although you can’t edit , you can save the context state to allow the user to undo actions, essentially to do real-time editing.
SVG is great for graphic basics such as displaying a resolution-independent company logo that scales to any screen size without pixel distortion.
Fractals and Mandelbrot sets are just two types of complex data visualizations that are well suited for SVG.

Thursday, November 10, 2011

Author complete Mobile Applications for Android and I Phone in Java Script!


ShareThis

Did you know that you can author complete Mobile Applications for Android, IPhone and other mobile platforms in Java Script?

There are two major Application Development frameworks available today that let you author mobile applications in Java Script:

  1. PhoneGap
  2. appcelerator

PhoneGap is an HTML5 app platform that allows you to author native mobile applications with web technologies and get access to APIs and app stores. PhoneGap leverages web technologies developers already know best... HTML and JavaScript.

appcelerator.com has released a Java Script SDK and a small IDE in which you write code in pure HTML/CSS/JS and it compiles mobile apps for you out of it.

The compiled code is nothing but native mobile code that you could write in Java (for Android) or Objective C (for I phone/I pad)

The Same code can also be compiled in to a Desktop Application.

The extend JS library of this supports full File System access and other all sorts of features that’s available in a standard desktop app.

If you are expert in JS libraries like JQuery, DOJO, YUI etc. you are with an advantage!!

I gave it a trial and results are quite exciting, although the IDE is in its infancy.

Give it a try!!

Friday, October 28, 2011

20 Best Practices for Speeding up Your Website


ShareThis

1.    Make fewer HTTP requests
•    Use CSS Image Sprites & Image Maps
•    Combine multiple script/css files into one
•    Use inline embedded images in the HTML

2.    Use a CDN
3.    Add an Expires or a Cache-Control Header
4.    Gzip components
5.    Put stylesheets at the top & scripts at the bottom
6.    Make JavaScript and CSS external
7.    Reduce DNS lookups
8.    Minify JavaScript, CSS and HTML
9.    Avoid Redirects
10.    Make Ajax cacheable
11.    Remove duplicate scripts
12.    Configure ETags
13.    Use GET for AJAX Requests
14.    Post-load Components
15.    Preload Components
16.    Reduce the Number of DOM Elements and events
17.    Split Components Across Domains
18.    Minimize the Number of iframes
19.    Optimize Images
20.    Keep Components under 25K

Spectrum of Modern Web Applications


ShareThis

I am more fascinated these days with the new approaches developers are discovering to author modern web aps. Java Script and JQuery is the center of the attraction in all the approaches. Sharing here, the summary of what I read in the documentation of a Microsoft initiative called Project Silk  to author modern web aps..

Spectrum of Web Applications

There is a spectrum of web applications being built today that can be grouped into four application types. These types of web applications are categorized by their full-page reload behavior and the amount of client-side interactivity they provide. Each application type provides a richer experience than the one listed before it.

  • Static sites. These consist of static HTML pages, CSS, and images. They are static in that as each page is navigated to, the browser performs a full-page reload and there is no interaction with portions of the page. In addition, the page does not change no matter who requests it or when.
  • Server rendered. In this model, the server dynamically assembles the pages from one or more source files and can incorporate data from another source during the rendering. The client-side script in these applications might perform some data validation, simple hover effects, or Ajax calls. As each page is navigated to, the browser performs a full-page reload. ASP.NET applications that don't make heavy use of client-side JavaScript are examples of server-rendered web applications.
  • Hybrid design. This model is similar to the server-rendered web application, except that it relies heavily on client-side JavaScript to deliver an engaging experience. This type of application has islands of interactivity within the site that do not require full-page reloads to change the UI as well as some pages that do require a full-page reload. Mileage Stats is an example of a hybrid design.
  • Single-page interface. In this model, a full-page load happens only once. From that point on, all page changes and data loading is performed without a full-page reload. Hotmail, Office Live, and Twitter are examples of single-page-interface web applications.

Characteristics of Modern Web Applications

While there are many types of modern web applications, addressing many different needs, they all have some characteristics in common.

  • They are standards-focused. To have the broadest reach across multiple platforms and devices, applications attempt to implement the current and evolving standards and adopt future standards once ratified.
  • They are interactive. Modern web applications keep the user engaged by providing constant feedback on their actions. This feedback can come in the form of messages, animations to hide or show elements, mouse-over effects, drag and drop feedback, the automatic refreshing of screen data, animation of various elements, or the implementation of fade-in or fade-out effects. Interactive applications leverage the fast JavaScript engines in modern browsers to perform their client-side tasks.
  • They limit full-page reloads. Modern web applications seek to limit the number of full-page reloads. Reloads are much slower than a localized Ajax call to update a portion of the UI. Full-page reloads also limit the ability to animate state or page changes. By not performing a full-page reload, users can be kept in context, providing a fluid experience as they navigate from one task to another.
  • They are asynchronous. Modern web applications use Ajax to dynamically load data, page fragments, or other assets instead of performing a full-page reload to acquire data or HTML content. Because the loading of data is asynchronous, the UI is able to stay responsive and keep the user informed while the data request is being fulfilled. This asynchronous on-demand loading also reduces application response time because requests can be tuned to return only the data and other content that needs to change.
  • They manage data. When applicable, modern web applications provide client-side data caching and prefetching to boost client-side performance. This enables the UI to immediately respond to user input gestures because it does not have to make a call to the server for data. Data caching also serves to minimize the impact on server resources, increasing application scalability because fewer calls to the server are required.

Monday, October 19, 2009

Add Speech recognition in your web pages


ShareThis
WAMI is a simple way to add speech recognition capabilities to any web page. Actually its a MIT research project.
I tried its working !. Further development is underway. One can try few live samples linked at homepage.

Read a tutorial here:



JQuery plugin to animates over distance instead of time.


ShareThis
Approach is a jQuery plugin that allows you to animate style properties based on the cursor’s proximity to an object. It works in a very similar manner to jQuery animate, however it animates over distance instead of time.


See a working sample and demonstration here:

Sunday, October 11, 2009

Open Source, Java Script and PHP


ShareThis
I am fond of reading about new technologies and happenings in the software development world.
I am sharing about the new things I find on the web now and then...


Open Source:

Open Source is the buzz-word today ! Even Microsoft is going the "Open Source" way.
Microsoft has introduced full support for PHP in its Web Server Product called IIS. MS now help you install and configure PHP in your IIS by its Web Platform Installer.

Microsoft is promoting Open Source community and products on its site also.
Check out these Ope Source projects in PHP and Dot Net on Microsoft website.


Microsoft has earlier included JQuery (a open source Java Script Framework/ library)

In Dot net platform Open Source projects are increasing day by day.
Here are few Open Source projects developed in Dot Net platform:



Java Script

Java Script is really exciting, but was not earlier when there were no Java Script frameworks available out there.
JQuery has increased lot of interest of programers in JS.

Few useful JS frameworks, libraries and toolkits I have recently found are listed below:

I checked, its really awesome.

  • Check out this Java Script Tooltip Library that provides you very easy methods to bring up fully customizable tool-tips for any HTML element.

  • I found a good JS code snippet to show Client Side Time in the browser. Check it out here


PHP

  • Have you ever required to read from EXcel, PDF, HTML and other Data Sources in PHP ?
Try out this PHPExcel library for reading and writing data from Excel and otehr data files. You can create Excel2007 documents in PHP.
Check out all features here.


Will be righting again soon.

Exciting JS Tooltip Libraray


ShareThis
Exciting JS Tooltip Libraray

Check out this exciting Java Script tool-tip library. There are a number of customization option.
Usage is very easy.



Free JQuery Animation library for ASP.net


ShareThis
Today I got a free JQuery Animation library for ASP.net

I tested, the performance is good with Intellisence support in Visual Studio.

Compatible versions for dot net F/W 2.0 and 3.5 are available. Although the help system is not woking corectly but one can acquaint with it soon.

Its worth a try.

Saturday, September 12, 2009

JSON is fun- JSON is for masses


ShareThis
JSON is fun- JSON is for masses
Really a interesting and great post / article on JSON

Sunday, June 29, 2008

Restricting user to visit previous pages after user logs out


ShareThis
Its have been a crital task for me for a variety of web aps for restricting users to visit previous pages after he logs out. I have did a lot of research and got many solutions, from using meta tags, to altering the request's headers etc. but the best way I found is by suing Java script along with these mentioned methods.

Particularly using two or more methods make the solution fool proof..
I will write a detailed article on this sub. soon till intereste dfolks should read this good java script resourse...

http://www.hunlock.com/blogs/Mastering_The_Back_Button_With_Javascript

Some more relevant posts resourses over the net:
Pragma: No-cache" Tag May Not Prevent Page from Being Cached

how could I disable the browser's back button using javascript?
------------------->
About the only way you can do this is to open a new window using window.open() (specifying that the browser history should not be copied to the new window) and then close the existing one.
=======================================


It can be done in 4+ browsers but it doesn't really disable the back button, just erases the data behind it to an extant.

replace Method
The replace method replaces the current History entry with the specified URL. After calling the replace method, you cannot navigate back to the previous URL using the browser's Back button.

Syntax: location.replace(URL)

This will replace the history with the current link every time a link is clicked
code/font>

<SCRIPT>
function getTag(el,str) {
while ((el!=null) && (str.indexOf(el.tagName + ":")<0))
el = el.parentElement
return el
}

function navigateTo(sURL,target) {
if ((target == '_self') | | (target=="")) {
window.location.replace(sURL);
return false;
}
if (target == '_top') {
top.window.location.replace(sURL);
return false
}
if (target =='_parent') {
parent.window.location.replace(sURL);
return false;
}
if (target == '_blank' | | parent.frames.length < 1) {
window.open(sURL, target);
return false;
}
else {
if (parent.frames[target])
parent.frames[target].location.replace(sURL);
else
window.open(sURL, target);
return false;
}
}

function checkIEClick() {
var el = getTag(event.srcElement,"A:AREA:")
if ((el!=null) && ((el.tagName=="A") | | (el.tagName=="AREA"))) {
event.returnValue = false
navigateTo(el.href,String(el.target).toLowerCase())
}
}

function checkNSClick(ev) {
if (ev.target.href) {
navigateTo(ev.target.href,String(ev.target).toLowerCase())
return false
}

}

if ((document.all) | | (document.layers))
if (document.layers) {
document.captureEvents(Event.CLICK)
document.onclick = checkNSClick
}
else
document.onclick = checkIEClick
</SCRIPT>
[/code]

A little slick redirection:
code/font>

<META HTTP-EQUIV="Refresh" CONTENT="1; http://www.insideDHTML.com/home.asp">
<SCRIPT>
<!--
var version = parseInt(navigator.appVersion)
// replace is supported
if (version>=4 | | window.location.replace)
window.location.replace("newPage.htm")
else
window.location.href = "newPage.htm"
// -->
</SCRIPT>
The document, <A HREF="newPage.htm">Scott's Home</A> has moved.
[/code]

The above code was found at Site Experts. I hope it is useful.
==========
Wayne Luke - Sitepoint Forums Administrator
(http://www.sitepoint.com/forums/showthread.php?t=8315)
===================================================================

Here are some work arounds but not fool froof as the auther him self says:

http://www.htmlgoodies.com/tutorials/buttons/article.php/3478911
http://www.irt.org/script/311.htm

===================================================================

Sunday, June 15, 2008

Java Pattern and Practices


ShareThis
Java is a vast language that has initiated many new coding patterns and practices.
I have been fond of Java programing though my productivity centralizes on Dot Net Platform.

Here I found many of the patterns and practices documented / listed at a single place.
It can be a good repository for learners :
http://mindprod.com/
http://mindprod.com/jgloss/designpatterns.html

Wednesday, June 11, 2008

Creating a HTML editor in ASP.net


ShareThis
Creating a HTML editor in ASP.net has been a herculean task in web applications
here is a working and tested solution at Code Project.

Expanding Grid View using Java Script


ShareThis
A good article here at Code Project describing about :Expanding Grid View using Java Script.
Was useful for me.

Beginner Article : How to make a website fast


ShareThis
I read a good articles for that might be useful for beginner / novice Web developers here at Code Project.

Author describes about how page requests are fulfilled, DNS working, functioning of CSS, Java Script etc. and how to speed them fast and much more...

Visit to this page will be worth..
Happy Reading