Nothing to see...

A simple blog about all things in the world that is ridikulouse.

Technological steps, are man kinds greatest achievements

Not a Fighter, but a lover of Tech.

Love of the internet

The Internet is the final frontier for open connected networks, it promotes speech and advances knowledge for any mere person. The internet is fast becoming a need rather a want, and it is recognised by the UN as a necessity for the modern person.

Photography

Photography is more than just Art and expression, it is the manipulation of the light and provokes emotion and memories.

Have a look around

The articles on this blog represent my thoughts and views at the time of writing, I can always change my views through further education...please don't hold me against my views. Some of the articles have been written to assist anyone else with similar issues - it also helps me to remember. Hope you get something out of this.

Thursday, April 14, 2011

Jquery IPWEDITOR, tinyMCE, and Live

Hi,
I thought that I would share this with you: I wanted to add DOM elements and have the IPWEDITOR with tinyMCE fire everytime I clicked the element to launch tinyMCE. I found out how to do it when elements are in the dom and then have the jquery code fire-up, however, I couldn't get it to fire when I'm dynamically loading elements into the dom.

So here's what I did, I used the live function in jquery:

Normally:
//Create an instance of the TinyMCE    var ed = new tinymce.Editor(".f_editableArea", {                    some_setting: 1                });
//Apply this to a selection$(".f_editableArea").editable({                    type: "wysiwyg",                    editor: ed,                    onSubmit: function submitData(content){                        alert(content.current)                    },                    submit: 'ok',                    cancel:'cancel'                });




Now, to use the live function you would do it this way :


    var ed = new tinymce.Editor(".f_editableArea", {
                    some_setting: 1
                });
 $(".f_editableArea").live("click", function(){                    $(this).editable({
                    type: "wysiwyg",
                    editor: ed,
                    onSubmit: function submitData(content){
                        alert(content.current)
                    },
                    submit: 'ok',
                    cancel:'cancel'
                });
 });

The highlighted section is the new section, I simply called the live function on the selection passing in the event as click and using a function. I then used this to call the selection and launch the plugin.

I hope this helps...

Saturday, January 15, 2011

Happy New Year - JQuery Learning

Just wanted to wish everyone a happy new year. New year new beginings.

Over the last couple of months I have been trying to learn the jQuery framework, along with javascript. I last touched javascript back in the early days, I guess you can call it early days, in around 2001. But at that stage the use of javascript was quite limited. When I had a look at some of the examples, it certainly did look like something that was good, but with a client side calculator and some odd client side manipulation etc... it wasn't very appetizing.

So what has changed in since then ? Well the main item that has come on to the seen which has really shaken the world is AJAX. Based on this client / server programming has taken a step forward on the web, and this is why I'm looking into jQuery.

jQuery is a framework, and it is not a new language - underneath the hood is javascript. However, the power of the framework is how it makes complex tasks really simple. I wont provide an example here, purely because there are plenty of examples on the web. What this means is that the common tasks which are in the framework will generally be cached on your visitors computer. Hence the load time for the page is significantly reduced, also the complex tasks of browser compatibility and coding problems of browsers has been taken out of the hands of coder. Instead the framework takes care of all of this.

If you want more information on this please go http://www.jquery.com, for a newbie to this world I have to say that I struggled to get into the context of jquery and at times I felt it would have been easier if I had just used .getElementByID instead of the selector. But overtime I started to enjoy the selection power that jquery offered.

Apart from www.jquery.com I stumbled upon http://jqfundamentals.com/book/book.html#N20057 which really explained everything.


I hope this has helped someone get into the jquery world.