Archive for the ‘Scripts’ Category

Today i was looking how to do jQuery alert, like i do it on every javascript. Well, its the same, you can simply use:

$("li").click(function(){
          var current_id=$(this).attr('id');
          alert(current_id);
          // these alert two times one is empty another one is content_1

   });

But then again, this is only usefull when programing. I went for a search for best jQuery plugins to do some proper jQuery alert dialogs. This is the first one i found:

jqModal is a lightweight window plugin written for jQuery which improves & makes easier the use of windows. jqModal is a plugin for jQuery to help you display notices, dialogs, and modal windows in a web browser. It is flexible and tiny, akin to a “Swiss Army Knife”, and makes a great base as a general purpose windowing framework.

But then i found excactly what i was looking for:  jquery alert dialogs

This plugin utilizes the $.alerts namespace, but there are three built-in shortcut functions that make implementation easier:
jAlert(message, [title, callback])
jConfirm(message, [title, callback])
jPrompt(message, [value, title, callback])
Unlike their native JavaScript counterparts, you can use HTML in the message parameter. To specify a newline, you can use either \n or <br />

This plugin utilizes the $.alerts namespace, but there are three built-in shortcut functions that make implementation easier:

  • jAlert(message, [title, callback])
  • jConfirm(message, [title, callback])
  • jPrompt(message, [value, title, callback])

Unlike their native JavaScript counterparts, you can use HTML in the message parameter. To specify a newline, you can use either \n or <br />

Check out the demo.

This weekend i needed to extend wordpress basic functionality. I was using the get_the_category function, wich returns an array of objects, one object for each category assigned to the post. What i needed was to display only categories, belonging to exactly one parent.

I search the internet, but surprisingly i didn’t find what i was looking for. So i had to extend wordpress get_the_category function:

function get_the_category_extend($postID, $parent_of=-1){
$out = array();
foreach((get_the_category($postID)) as $category) {
if($parent_of!=-1){
if($category->category_parent == $parent_of){
$out[] = $category;
}
}
}
return $out;
}

It gets post ID and a ID of a parent. It returns only child categories. Yes, its very simple :)

You copy this function into functions.php, located in your theme directory. You can upgrade this function with whatever you need, if your nice you can even post it here…

XML is an integral part of AJAX – it means “Asynchronous JavaScript and XML”, so its important to know how to parse XML on the fly.

Till now, we could write our own javascript functions – or better use jQuery to parse XML. You can find few tutorials if you search for “jquery xml parse“, so its not hard to do it.

But now it became even easier – there is a plugin called jParse, wich is doing just what we need: it allows you to quickly and easily parse XML.

parse-xml-jquery

With the jParse jQuery plugin, you can parse XML that is returned from an jQuery Ajax request. jQuery .ajax method does not allow for cross domain Ajax requests, so the XML that you would like to parse must be on the same domain from which you are working.

You can pull many types of information from an XML document like the value of an XML node, the value of an attribute of an XML node, or the number of <items> in an XML document.

Life became a little easier again ;)

Script.aculo.us is the most known and widely used add-on for the Prototype JavaScript Framework with the features like animation framework, drag and drop, Ajax controls, DOM utilities, and unit testing. It provides you with easy-to-use, cross-browser user interface JavaScript libraries to make your web sites and web applications fly.

Scripty2: A rewrite?!

Yes, it’s all new. The old code was just to crufted and packed with workarounds for browsers no one uses any more, so I’ve decided to start anew and write the effects engine from scratch. With all the knowledge gained from years of using the effects
on various projects, it’s now ready for the future (and it looks bright!).

Yes, it’s all new. The old code was just to crufted and packed with workarounds for browsers no one uses any more, so Thomas Fuchs decided to start anew and write the effects engine from scratch. With all the knowledge gained from years of using the effects on various projects, it’s now ready for the future (and it looks bright!).

New Script.aculo.us

Continue Reading

Phparch.com is launching The Great PHP on Windows Contest. Usualy PHP partners with linux, Apache and MySQL, but they are starting contest to promote running PHP on Windows.

PHP on Windows Contest

The basics of the contest are simple:
Write a new application designed to run in PHP on Windows using IIS—or make a significant contribution to an existing open-source project along the same lines
The best application, selected jointly by a panel of experts and by our readers, will win a grand prize composed of a 52″ Digital HD home entertainment system, as well as an all-expenses paid trip to php|tek 2010 in Chicago. Runner-up prizes include 2 XBox 360 Ultimate and subscriptions to php|architect.
Not familiar with Windows? No worries—we have partnered with Applied Innovations to give you absolutely free hosting on a pre-configured virtual machine for the duration of the contest.
The contest is open to residents of the United States only—but you can still win by voting, no matter where you are.

The basics of the contest are simple:

  1. Write a new application designed to run in PHP on Windows using IIS—or make a significant contribution to an existing open-source project along the same lines.
  2. The best application, selected jointly by a panel of experts and by our readers, will win a grand prize composed of a 52″ Digital HD home entertainment system, as well as an all-expenses paid trip to php|tek 2010 in Chicago. Runner-up prizes include 2 XBox 360 Ultimate and subscriptions to php|architect.
  3. Not familiar with Windows? No worries—they have partnered with Applied Innovations to give you absolutely free hosting on a pre-configured virtual machine for the duration of the contest.
  4. The contest is open to residents of the United States only—but you can still win by voting, no matter where you are.

Sound interesting? Sign up :)

If you’re looking for a PHP script that can resize image for your web application, TimThumb is a good PHP image resize script for you.

The custom image-resize script created for Mimbo Pro is now available as an open-source project!

image_resize

Continue Reading

Raphaël is a small JavaScript library that should simplify your work with vector graphics on the web. If you want to create your own specific chart or image crop and rotate widget, for example, you can achieve it simply and easily with this library.

Raphaël

Continue Reading

© Copyright Webspices.net. All Rights Reserved.