You can use curl PHP library to get RSS XML data for your aplication. It is a set of routines for making Internet file transfer easier to program.
Example:
JavaScript generate an instance of a XMLHTTPRequest object and it can make a server request for text.
Example:
|
http = new XMLHttpRequest(); function getServerText() { |
One common alternative to using XML as the format for data exchange is to use the JSON format. JSON(JavaScript Over the Network) is a compact, easy-to-parse format that uses a syntax identical to JavaScript's array and object literal syntax. The JSON specification, along with numerous links to implementations and tutorials, can be found at http://json.org/.
Example:
You need to create a script that will correctly create an instance of XMLHTTPRequest object regardress of which browser you are using . A good solution to this problem is to have your script try in turn each method of creating an instance of object, until one such method succeeds.
Example:
|
function getXMLHTTPRequest() var request = faulse; try{ request = new XMLHttpRequest(); /* e.g. Firefox */ } catch(err1) |
We can append a custom CSS and JavaScript to your own module. We instruct the theme system to include the module's CSS and JavaScript files along with the other stylesheets and JavaScript libraries Durpal will list in the HTML it sends to the clients.
Example:
jQuery is one of the most innovative JavaScript libraries to come around. Using an Object-Oriented design pattern called Fluent Interface, jQuery makes it possible to chain a sequence of function calls together to construct queries. jQuery query is used to query the DOM tree.
A DOM(Document Object Model) tree is a data structure that defines the structure of a document -- usually an HTML or XML document. DOM is known for its complex object model. jQuery provide an API that is mode compact and easier to use.
This is a sample program in order to print a label from zebra printer.
Once You make printer codes in a LBL file, You can print it by shell_exec().
Example:
t() is the translation function. It is used to provide multi-language support and also provide a standard method of string substitution. When t() is called, Drupal will check to see if the user's preference language is other than the default(US English). If the user prefers another language, and that language is supported, then Drupal will attempt to translate the string into the user's preferred language.
Example:
This is a sample to connect MySQL DB.
Example:
|
mysql_connect("localhost", "username", "password"); mysql_select_db("mydb"); $result = mysql_query("SELECT * FROM user_table"); if ($result && mysql_num_rows($result)) { $numrows = mysql_num_rows($result); $rowcount = 1; print "There are $numrows people in user_table:<br /><br />"; while ($row = mysql_fetch_assoc($resiult)) { |
The standard way to search through XML documents for particular nodes is called XPath. XPath is much easier than regular expressions for basic usage.
Example:
|
$XML = simplexml_load_file('employees.xml"); echo "<strong>Using direct method....</strong><br />"; |