I'm trying to call a view in Elgg via AJAX, but nothing works after >>HERE<<
requirejs(["elgg/Ajax"], function(Ajax) {
var ajax = new Ajax();
//rest of your code!!
$('.glyphicon-zoom-in').click(function(event) {
$( '.full-image-view' ).css( "color", "red" ).append('<div>This Shows Well</div>');
// **>>HERE<<**
ajax.view('albums/inline_full_image_view', {
data: {
guid: 123 // querystring
},
}).done(function (output, statusText, jqXHR) {
if (jqXHR.AjaxData.status == -1) {
return;
}
$('.full-image-view').html(output);
});
});
});
Output : This Shows Well
What could I be getting wrong?
Thank you all in advance.
inline_full_image_view.php
<?php
echo 'Hello World';
info@elgg.org
Security issues should be reported to security@elgg.org!
©2014 the Elgg Foundation
Elgg is a registered trademark of Thematic Networks.
Cover image by RaĆ¼l Utrera is used under Creative Commons license.
Icons by Flaticon and FontAwesome.
- ihayredinov@ihayredinov
ihayredinov - 0 likes
- Revilo@Revilo
Revilo - 0 likes
- ihayredinov@ihayredinov
ihayredinov - 0 likes
- Steve Clay@steve_clay
Steve Clay - 0 likes
You must log in to post replies.Did you register 'albums/inline_full_image_view' as an ajax view using elgg_register_ajax_view()?
Thank you for the reply @Ismayil Khayredinov. I did register it in start.php, in the init function.
Check your Network traffic in the console and see if the request is being sent and what the response is.
The function is require not requirejs.