cotonti.com : Ajax in Plugins? https://www.cotonti.com Последние сообщения в теме Cotonti en Fri, 28 Nov 2025 01:49:39 -0000 urlkiller
btw when working with ajax you should plan from the beginning where and when you use it.
just only having ajax is not the right way. it should safe page load time and traffic in general.

for example it would be unnecessary to use ajax to load a whole area if only one image changes.
(like in the administration panel... ;( )
so plan you plugin with a mindmap or something that you have a clean overview over all functions.

the json part mentionend earlier is the BEST way because you only submit a small part with important information (like an array in php) instead of the whole html code... xml is the second best use with ajax. its much more newbie friendly because you can read out the xml file directly with php and thats pretty good to understand... so maybe you should start with that...


another way could be to "header" something over the ajax part. a pdf file or an image for example.


the ajax part in cot is really a big advantage over the neocrome release...
thanks for that devs!]]>
вт, 08 июн 2010 05:22:20 -0000
scriptor Great]]> пн, 07 июн 2010 16:21:47 -0000 urlkiller the "quellcode" = sourcecode wont show you the output generated by javascript.
you need to add the rel tag to your images in you ajax part that make the code.. and it should work...

or use the above code to insert the rel afterwards the code gets generated...]]>
вс, 06 июн 2010 22:41:01 -0000
ez
// AUTOLOAD CODE BLOCK (MAY BE CHANGED OR REMOVED)
if (!/android|iphone|ipod|series60|symbian|windows ce|blackberry/i.test(navigator.userAgent)) {
	jQuery(function($) {
		$("a[rel^='lightbox']").slimbox({/* Put custom options here */}, null, function(el) {
			return (this == el) || ((this.rel.length > 8) && (this.rel == el.rel));
		});
	});
}

this code (inside slimbox.js) runs when your page is loaded... but since you load images later (ajax), these images does not go with the initial load... (so slimbox will not fire !, on the ajax images)

run this code again.. (Warning: initial images get hit twice maybe... ??, i do not know what would happen... you should test it on a normal image and on a ajax image)


Maybe do it like this SAFER WAY

your ajax image:
In the ajax images do
<a href=https://www.cotonti.com/"images/image-1.jpg" rel="ajxlightbox" title="my caption">image #1</a>

The code that you should run AFTER the ajax image is loaded.
// AUTOLOAD CODE BLOCK (MAY BE CHANGED OR REMOVED)
if (!/android|iphone|ipod|series60|symbian|windows ce|blackberry/i.test(navigator.userAgent)) {
	jQuery(function($) {
		$("a[rel^='ajxlightbox']").slimbox({/* Put custom options here */}, null, function(el) {
			return (this == el) || ((this.rel.length > 8) && (this.rel == el.rel));
		});
	});
}


You can also use id's or something.. just change the JQuery selector

// $("a[rel^='lightbox']")
$("#idofmyajaximage")

In the ajax images do this
<a href=https://www.cotonti.com/"images/image-1.jpg" id="#idofmyajaximage" rel="lightbox" title="my caption">image #1</a>



ANYWAY you are on your way now with Help ..

greetz, EZ]]>
сб, 05 июн 2010 15:25:37 -0000
scriptor сб, 05 июн 2010 04:29:16 -0000 urlkiller
;) it was meant that way. thanks for your help again ;)]]>
пт, 04 июн 2010 22:59:50 -0000
ez

p.s. Go JSON for responses (that handles so great in javascript !!)]]>
пт, 04 июн 2010 22:35:57 -0000
scriptor пт, 04 июн 2010 22:26:56 -0000 ez I am using it more and more, it is great :D , I do not like complete page refreshes, and with ajax
you only change parts off your screen.

I use a lot of JSON for the reponses, that rocks...

@urlkiller: thnx i'll take that as a compliment :)

I can see what I can do, could you tell me what info you want ?]]>
пт, 04 июн 2010 13:39:38 -0000
urlkiller but we could take that to the german forums as iam able to speak it ;)
there i could give you some pointers.

edit: also EZ seems pretty good with that AJAX parts...]]>
пт, 04 июн 2010 11:00:44 -0000
GHengeveld
Basically what the ajax hook does is skip the parsing of the header and footer, so it only outputs the data returned by the plugin itself. Very useful if you want to return JSON or XML.]]>
пт, 04 июн 2010 08:48:28 -0000
scriptor пт, 04 июн 2010 03:55:43 -0000