Hi drupal community,
i'm making my site, working with ajax.
i use the following code, which i inject with the module "JS injector", to implement this:
Drupal.behaviors.my_ajax = function(context) {
$('#content-group-inner a').live('click',function(e) {
var url = $(this).attr('href');
//$('#content-region-inner').slideUp('slow');
$('#content-region-inner').empty().html('<img src="ajax-loader.gif" style="margin-left:50%;"/>');
$('#content-region-inner').load(url+" #content-region-inner", function(){
$('#content-region-inner').slideDown('200');
});
return false;
});
};
This is working great, but on some content, or forms, the JS seems to be disabled. But it isn't, i can also see, that the js scripts are loaded in the head.
In another case, like in forum, my Css isn't fully applied to the site, so my layout seems to be a little bit broken.
I was reading about the "Load ajax" module, but using this module causes my layout to break even more.
So can someone tell me how to solve my prob, or give me some suggestions on how the way could be to solve this issue.
I was searching almost the whole forum for my topic.
It seems, that many others are having the same problem not limited to a certain module.
But unfortunately i didn't find any solution.
Wouldn't it be great to solve this?
Why do we not speak together about this?
Every help and suggestion is appreciated.
Thanx a lot for your support and suggestions.
dennis605
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | forum_regular.png | 23.76 KB | dennis605 |
| #2 | forum_ajaxed.png | 36.86 KB | dennis605 |
Comments
Comment #1
rfayChanging to Javascript component as it doesn't seem to have to do with AJAX forms or core AJAX.
I suspect you'll have to do a much more extensive description to get help with this. It even seems that it might be related to js_injector.
You may want to create a sandbox with some sample code (that does *not* use js_injector) to demonstrate this problem clearly.
Also, to get any traction here, you'll probably need to see if this is a problem in 7.x/8.x.
Comment #2
dennis605 commentedHello rfay,
thanks for your reply.
In fact i tried to get this working within a module.
my_ajax.module:
my_ajax.js:
But the issue i mentioned above still appears.
For example:
1.
I use the hierarchical_select module on my node/create form. When i request the form via ajax, with the method above, it tells me that js is disabled, and i should enable it. But it is enabled. The module does not recognize, that i load this form.
2.
I'm using the addtoany module on certain nodes. One function of this module is, that when you hover over the addtoany button, a form will appear, where you can make a choice, how and where to send the content. When i get this node via ajax, and i hover over the button, form does not appear.
3.
When i go to my forum with "www.example.com/forum" my forum is appearing the right way.
You may look the attached screenshots:
forum_before: opened the regular way.
forum_after: opened the forum via ajax.
I do not know, what else information you may need. Please let me know.
with regards
dennis605
Comment #3
dennis605 commentedCan't anybody tell me, what to do for getting this working?