ajax(asynchronous java script and xml) is an asynchronous version of java script. that means, on synchronous request,the full page is reloaded and user has to wait until it loaded. but at asynchronous request, page remains as before when requested and only the portion, that requires changes, is changed after response recievied . Thress basic steps are enough to handle asynchronous request:
* create request object
* send request
* receive response
here is the function that creats & return request object:
function HTTPObject()
{
var xmlHttp;
try
{
// Firefox, Opera 8.0+, Safari
xmlHttp=new XMLHttpRequest();
}
catch (e)
{
// Internet Explorer
try
{
xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
}
catch (e)
{
try
{
xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
}
catch (e)
{
alert("Your browser does not support AJAX!");
return false;
}
}
}
return xmlHttp;
}
Here is how to send the request:
var xmlHttp = HTTPObject();
var req = "a relative/absolute url";
xmlHttp.open("GET",req,true);
xmlHttp.send(null);
Here is the code snippet to receive the response:
xmlHttp.onreadystatechange=function()
{
if(xmlHttp.readyState==4)
{
alert(xmlHttp.responseText);
}
}
Just using this basic concept many more complex ajax operations can be achieved. Just try out.
0
As an internet surfer, we always take part to various kinds of forums to discuss, share our opinion, learn from other members articles, helping others also. The forums owner earn money from advertising, adsense etc. But we get nothing to participate except the knowledge.

But, there is a site I just came to know about which gives share of its revenue to its members to participate on quality discussions. These scheme is known as 'paid to post forum'. But also there are a lot of scams out there. But this site, that i am talking about, is really a quality site & running for long days, also have a page rank of 6, which represents its reputation clearly. Moreover, this site has some extra tasks section, where you can earn money by completing various kinds of sponsored tasks.
Basic features:
* Get paid to post quality discussion.
* Get paid to participate on others discussion.
* Get paid to upload photos/images.
* Get paid to complete various sponsored tasks.
* Get paid to participate at Affiliate program.

But, there is a site I just came to know about which gives share of its revenue to its members to participate on quality discussions. These scheme is known as 'paid to post forum'. But also there are a lot of scams out there. But this site, that i am talking about, is really a quality site & running for long days, also have a page rank of 6, which represents its reputation clearly. Moreover, this site has some extra tasks section, where you can earn money by completing various kinds of sponsored tasks.
Basic features:
* Get paid to post quality discussion.
* Get paid to participate on others discussion.
* Get paid to upload photos/images.
* Get paid to complete various sponsored tasks.
* Get paid to participate at Affiliate program.
We can embed windows media player in a html file easily , which can play popular windows media formats as like flash flv player. To do so, we have to use a simple & little code-snippet as follows:
<embed src ="yourvideo.wmv" allowfullscreen="true" width="424" height="344" autostart="false" /> </embed>
With help of this code video file(all formats supported by windows media player) will play very well. But a general issue occurs most of the times. In internet explorer, it works well, but in firefox it start automatically, where we may not want this to be start automatically. Also, behaviour are getting different in cross browser, that is also an important fact. without clicking start. the attribute autostart="false" doesn't work on firefox.
Actually autostart="true/false" indicates whether the sound track should start automatically upon loading or not. A "true" value means it should, a "false" value means it should not. The Explorer's default is "false" while firefox/Navigator's one is "true". The default on the Mac operating system is "false" for both browsers.
Use the following code to work correctly with ie & firefox both on windows. You have to use autostart="0", which is generalized for both browsers.
<embed src ="yourvideo.wmv" allowfullscreen="true" width="424" height="344" autostart="0" /> </embed>
<embed src ="yourvideo.wmv" allowfullscreen="true" width="424" height="344" autostart="false" /> </embed>
With help of this code video file(all formats supported by windows media player) will play very well. But a general issue occurs most of the times. In internet explorer, it works well, but in firefox it start automatically, where we may not want this to be start automatically. Also, behaviour are getting different in cross browser, that is also an important fact. without clicking start. the attribute autostart="false" doesn't work on firefox.
Actually autostart="true/false" indicates whether the sound track should start automatically upon loading or not. A "true" value means it should, a "false" value means it should not. The Explorer's default is "false" while firefox/Navigator's one is "true". The default on the Mac operating system is "false" for both browsers.
Use the following code to work correctly with ie & firefox both on windows. You have to use autostart="0", which is generalized for both browsers.
<embed src ="yourvideo.wmv" allowfullscreen="true" width="424" height="344" autostart="0" /> </embed>
You can show google map on your website for free. to do and use it successfully on your site you have to do the following steps:
* Register for a key with your domain, its must.
* Load google map api library on your web page as follows:
<script src= "http://maps.google.com/maps?file=api&v=2&key=yourkey" type="text/javascript"></script>
now u r ready to use google map api. take a div on page where you want to load the map like:
<div id="map"></div>
create your own java script code file to write code to use google map api libraries. write this basic code there:
function LoadMap()
{
if (GBrowserIsCompatible())
{
map = new GMap2(document.getElementById("map"),{size:new GSize(650,450)});
map.setCenter(new GLatLng(37.4419, -122.1419), 13);
}
}
*** Remember, you can set size of the div if its visible & that size will be used to load map. But, if you made the div style to 'display:none', then div's size won't be taken by javascript & that will be treated like 0 size & map will be loaded to its default size(500px X 300px). Then you have to pass extra parameter to set the size.
*** Always use GUnload() on body unload event to ensure that, google api resources are released when page is unloaded.
See documentation for all details more advanced features.
* Register for a key with your domain, its must.
* Load google map api library on your web page as follows:
<script src= "http://maps.google.com/maps?file=api&v=2&key=yourkey" type="text/javascript"></script>
now u r ready to use google map api. take a div on page where you want to load the map like:
<div id="map"></div>
create your own java script code file to write code to use google map api libraries. write this basic code there:
function LoadMap()
{
if (GBrowserIsCompatible())
{
map = new GMap2(document.getElementById("map"),{size:new GSize(650,450)});
map.setCenter(new GLatLng(37.4419, -122.1419), 13);
}
}
*** Remember, you can set size of the div if its visible & that size will be used to load map. But, if you made the div style to 'display:none', then div's size won't be taken by javascript & that will be treated like 0 size & map will be loaded to its default size(500px X 300px). Then you have to pass extra parameter to set the size.
*** Always use GUnload() on body unload event to ensure that, google api resources are released when page is unloaded.
See documentation for all details more advanced features.
We all know that, the first step to be an successful owner of a blog and/or website is to get traffic. But this step is quite hard maximum of the time. For this, we always take help of advertising. we have to pay to a website/advertising network for accomplish this.
But there are also way to get traffic without spending any money. these are called traffic exchange. the theme is, if you visit other member's site, your site will be also visited by others. here, you can either bye visits at very low amount of money, or can get credits for your own website/blog.
Among many traffic exchange sites, the best site is easyhits4u. this site is the most popular traffic exchange site. it has a lot of benefits besides getting credits. you can get free banner impressions, bonuses & also $$ rewards for being active surfer. So, as its an way to get traffic & money both. You can just join it and see how easy it is to get manual traffic to your blog/site.
Basic Features:
* Exchange Traffic either 1-1 ration(20 seconds visit) or 2-1 ratio(15 seconds visit).
* Continuous Bonus(including $$) on active surfing(start from only 25 visits).
* Guarantied Reward $0.30 for every 1000 visits.
* Referrals program. Earn credits,money from referrals. Up to 5 levels deep.
But there are also way to get traffic without spending any money. these are called traffic exchange. the theme is, if you visit other member's site, your site will be also visited by others. here, you can either bye visits at very low amount of money, or can get credits for your own website/blog.
Among many traffic exchange sites, the best site is easyhits4u. this site is the most popular traffic exchange site. it has a lot of benefits besides getting credits. you can get free banner impressions, bonuses & also $$ rewards for being active surfer. So, as its an way to get traffic & money both. You can just join it and see how easy it is to get manual traffic to your blog/site.
Basic Features:
* Exchange Traffic either 1-1 ration(20 seconds visit) or 2-1 ratio(15 seconds visit).
* Continuous Bonus(including $$) on active surfing(start from only 25 visits).
* Guarantied Reward $0.30 for every 1000 visits.
* Referrals program. Earn credits,money from referrals. Up to 5 levels deep.
Communication between different types of interfaces are very important in web development as many of them may be used on a web site. In the similar way, communication between flash application & javascript is also an important part. We can call a javascript function from flash-actionscript code & also vise-versa. flash-actionscript 3.0 code will be as like follows:
if (ExternalInterface.available)
{
returnvalue = ExternalInterface.call(javascript_functio_nname, [arguments_as_much_you_want]);
trace(returnvalue);
}
javascript function will do the functionality & also can return value to flash code, that will be saved in 'returnvalue' as i have mentioned in the code. javascript code will be as like follows:
<script language='javascript' type='text/javascript'>
function javascript_functio_nname([arguments_as_much_you_want])
{
//do something
return "javasript's data";
}
<script>
this is very simple code , but can be very useful in many situations. if you only want to call a flash function from javascript, you can also do that, just need to have the following code snippet;
ExternalInterface.addCallback("sendToActionScript", receivedFromJavaScript);
now u can call a flash-actionscript function from javascript. More details references are available on actionscript documentation
if (ExternalInterface.available)
{
returnvalue = ExternalInterface.call(javascript_functio_nname, [arguments_as_much_you_want]);
trace(returnvalue);
}
javascript function will do the functionality & also can return value to flash code, that will be saved in 'returnvalue' as i have mentioned in the code. javascript code will be as like follows:
<script language='javascript' type='text/javascript'>
function javascript_functio_nname([arguments_as_much_you_want])
{
//do something
return "javasript's data";
}
<script>
this is very simple code , but can be very useful in many situations. if you only want to call a flash function from javascript, you can also do that, just need to have the following code snippet;
ExternalInterface.addCallback("sendToActionScript", receivedFromJavaScript);
now u can call a flash-actionscript function from javascript. More details references are available on actionscript documentation
Subscribe to:
Posts (Atom)





