Category ArchiveGeneral
General & Web 2.0 tejas on 13 Dec 2006
Ajax Without XmlHttpRequest
IE 6 does support built in as an ActiveX control for XMLHttpRequest. Which means your visitors get an ugly warning message about the possible danger of an ActiveX control, or in some cases it just doesn’t work at all.
If we can’t use the XmlHttpRequest object, we must find some other way
to include content from another page, without having to resort to other objects
or non-standard things. A great candidate for this would be the tag, which is
used to include external JavaScript files. What if, instead of using a regular
JS file, we point that tag to a PHP file, which outputs JavaScript. A PHP file
which looks something like this:
<?php$html = '<b>This content came from our Ajax Engine</b>';?>div = document.getElementById('contentdiv'); div.innerHTML = '<?php echo $html; ?>';
When this file is used referenced in a script tag, it will try to set the innerHTML of a div with ID ‘contentdiv’. But there’s one problem; this file shouldn’t be included when the page loads, but only when a button is clicked or some other action. To do this, we must somehow dynamically add a new script tag, which is possible using JavaScript. Something like the following would do the trick:
// Get base url url = document.location.href; xend = url.lastIndexOf("/") + 1; var base_url = url.substring(0, xend);function ajax_do (url) { // Does URL begin with http? if (url.substring(0, 4) != 'http') { url = base_url + url; }// Create new JS element var jsel = document.createElement('SCRIPT'); jsel.type = 'text/javascript'; jsel.src = url;// Append JS element (therefore executing the 'AJAX' call) document.body.appendChild (jsel); }
This code first gets the current directory of the url, so we have a base url.
The ‘ajax_do’ function is the thing that does all the work. It first
checks whether the url passed to the function points to another domain, or is
a relative file.
It then creates a new script element, using the createElement() function. After that it sets the src attribute of the script element, and adds the script element to the body, effectively ‘loading’ the file that is referenced by the script element.
All we need now is a simple page that triggers the Ajax call, i.e.
<html> <head> <title> Demo 1 - The Basic's </title><script type = 'text/javascript' src = 'engine.js' > </script> </head><body> <div id = 'contentdiv' ></div><input type = 'button' onclick = "ajax_do ('page1.php');" value = "Get content" / > </body> </html>
General tejas on 04 Sep 2006
Hope this helps some of you!!![notepad]
This is really cool for people who use notepad to write down any info on day to day basis…
In Notepad -
Create a blank text file with .LOG as the first line of the file, followed by a carriage return. Save the file with any .txt extension.
Double-click the file to open it and notice that Notepad appends the current date and time to the end of the file and places the cursor on the line after.
Type your notes and then save and close the file.
Each time you open the file, Notepad repeats the process, appending the time and date to the end of the file and placing the cursor below it.
Hope this helps some of you!!!
General hiren.p on 30 Aug 2006
FAQs Google Search Engine
How do I submit my website to the Google Search Engine?
Submitting your website to the Google Search Engine is free, fast and
friendly.
Simply go to www.google.com/addurl.html and enter your website
domain name remembering to include the http:// prefixe.g.
http://www.mywebsite.com
Do I need to submit my website to local Google
Search Engines?
Google operates a large number of Search engines for virtually every country in the World. A single submission covers all Google Search engines around the world!
Do I need to resubmit my website to Google
search engine regularly?
No - once registered it is automatically updated.
What happens when pages get deleted?
Google will automatically remove them.
I submitted my website to the Google Search Engine some time ago and it still doesn’t appear in a Google search It can takes several months to get indexed - the web is a big place!
Make sure you keep your content fresh and up-to-date. In the meantime you can use the Google advertising system called Adwords to get traffic to your website.
General pushkar on 08 Aug 2006
Common Programming Errors
Common errors that occurred at starting time, run time. Most Beginners users have a difficulties with common errors. So some of them are listed below. Those are covered from Programing Language like C, C++, PHP, ASP, ASP.net etc.
1.Providing Spaces between the operators like = =,< =,> = and ! =.
2.Use operators = instead of ==.
3.Take identifier as KeyWord.
4.Starting and Ending brace doesnot match correctly.
5.Uninitialised Variables.
6.Placing commas instead of semicolons.
7.Placing semicolon immediately after for OR while condition.
8.Placing a semicolon immediately after a function header.
9.Define function inside another function.
10.Filename is not correct while reference from another file OR Including (In both Case and Spell)
11.Expected Error Like , ;
12.Use the function that is given in Higher Version Or in other Library.
13.Infinite loop condition.
14.Use of function without declaration. A typical error in C++.
15.Variable Declaration error like variable that use in whole coding should be declare as Global Variable.
16.Object Reference cannot be set as an instance of object. Very common Error in Dot Net. This can be solved by declaring object as
bq. Dim ds as dataset
bq. ds = New Dataset(”temp”)
17.Use same object twice for different purpose. Like in asp/asp.net Recordset rs.
General tejas on 27 Jul 2006
What was the first web browser?
Here is the first web broswer history i found on internet!
Tim Berners-Lee, who invented the World Wide Web in 1989 and first deployed a working system in 1990, did so by writing a web browser for the NeXTStep operating system. The original “WorldWideWeb” browser program had a graphical user interface and so on and is definitely recognizable to most people as a web browser. However, WorldWideWeb did not support graphics embedded in pages when it was first released. You can learn more about the original “WorldWideWeb” browser from Tim Berners-Lee himself.
Since WorldWideWeb had a graphical user interface (GUI), it could be called a graphical web browser. However it did not display graphics as part of web pages. That did not happen until the arrival of NCSA Mosaic 2.0.
The first graphical web browser to become truly popular and capture the imagination of the public was NCSA Mosaic. Developed by Marc Andreessen, Jamie Zawinski and others who later went on to create the Netscape browser, NCSA Mosaic was the first to be available for Microsoft Windows, the Macintosh, and the Unix X Window System, which made it possible to bring the web to the average user. The first version appeared in March 1993. The “inline images,” such as the boutell.com logo at the top of this page, that are an integral part of almost every web page today were introduced by NCSA Mosaic 2.0, in January of 1994. Mosaic 2.0 also introduced forms.
Netscape is the browser that introduced most all of the remaining major features that define a web browser as we know it. The first version of Netscape appeared in October 1994 under the code name “Mozilla.” Netscape 1.0’s early beta versions introduced the “progressive rendering” of pages and images, meaning that the page begins to appear and the text can be read even before all of the text and/or images have been completely downloaded. Version 1.1, in March 1995, introduced HTML tables, which are now used in the vast majority of web pages to provide page layout. Version 2.0, in October 1995, introduced frames, Java applets, and JavaScript. Version 2.0 was the last version of Netscape to introduce a major feature of the web as we know it today; later versions improved reliability and stability and introduced features that did not catch on as standards for all browsers. In 1998, Netscape decided to release their browser source code as open source software, and the Mozilla project began.
Microsoft Internet Explorer is by far the most common web browser in use as of this writing. Internet Explorer 1.0, released in August 1995, broke no important new ground in a way that became part of a future standard. Later versions of Internet Explorer quickly caught up; Internet Explorer 3.0 was very close to Netscape 2.0’s feature set. In July 1996, Internet Explorer 3.0 beta introduced the first useful implementation of cascading style sheets, which allow better control of the exact appearance of web pages. In April 1997, Internet Explorer 4.0 introduced the first quality implementation of the Document Object Model (DOM), which allows Javascript to modify the appearance and content of a web page after it has been loaded.
Which is next ![]()