I get the following error in Chrome, when trying out the ajax link example (http://api.drupal.org/api/examples/ajax_example--ajax_example_misc.inc) and I don't get what's wrong. Can somebody help me, please?

An error occurred while attempting to process drupal-7.0/?q=ajax_link_callback/ajax: Object function (j,s){return new b.fn.init(j,s)} has no method 'fieldValue'

Comments

jhodgdon’s picture

Title: Documentation problem with ajax_example_misc.inc » ajax_example_misc.inc gives Chrome error
Project: Drupal core » Examples for Developers
Version: 7.x-dev »
Component: documentation » AJAX Example

Moving to the Examples for Developers issue queue.

rfay’s picture

I confirm this problem using Chromium on Linux.

I suspect this may be a Drupal core issue.

rfay’s picture

Title: ajax_example_misc.inc gives Chrome error » ajax_example_misc.inc gives error: $.fieldValue is not a function

I just checked with FF 3.6, and it also fails there. On FF 3.6 the error is

An error occurred while attempting to process /ajax_link_callback/ajax/: $.fieldValue is not a function

Will ask katbailey to look at this before we pursue it in core.

katbailey’s picture

Assigned: Unassigned » katbailey

So, apparently we need jquery.form.js even just for a link that's being processed with the use-ajax class :-(
My memory is a little hazy on this but I do remember the fix for lazy-loading js files being very tightly bound up with form stuff (because it was doing everything on .beforeSubmit())
It seems deeply wrong that we'd need to add jquery.form.js to the page for this link example to work but I will go ahead and do that if that's all that can be done. I should also add an example that shows how do this with a link that has been defined as a renderable array with the #ajax property.

moestavern’s picture

I see. I hope this can be resolved in future versions as the ability to quickly use AJAX with links is somewhat essential to me.

Looking forward to the examples, katbailey. Thanks

moestavern’s picture

Adding

  drupal_add_js('misc/jquery.form.js');

results only in:

An AJAX HTTP error occurred.
HTTP Result Code: 404
Debugging information follows.
Path: /drupal/drupal-7.0/?q=ajax_link_callback/ajax/
StatusText: Not Found
ResponseText:
Page not found | Example Project
@import url("http://localhost/drupal/drupal-7.0/modules/system/system.base.css?lfllwz");
@import url("http://localhost/drupal/drupal-7.0/modules/system/system.menus.css?lfllwz");
@import url("http://localhost/drupal/drupal-7.0/modules/system/system.messages.css?lf...");
@import url("http://localhost/drupal/drupal-7.0/modules/system/system.theme.css?lfllwz");
@import url("http://localhost/drupal/drupal-7.0/misc/ui/jquery.ui.core.css?lfllwz");
@import url("http://localhost/drupal/drupal-7.0/misc/ui/jquery.ui.theme.css?lfllwz");
@import url("http://localhost/drupal/drupal-7.0/modules/overlay/overlay-parent.css?lf...");
@import url("http://localhost/drupal/drupal-7.0/modules/contextual/contextual.css?lfllwz");
@import url("http://localhost/drupal/drupal-7.0/modules/comment/comment.css?lfllwz");
@import url("http://localhost/drupal/drupal-7.0/modules/field/theme/field.css?lfllwz");
@import url("http://localhost/drupal/drupal-7.0/modules/node/node.css?lfllwz");
@import url("http://localhost/drupal/drupal-7.0/modules/search/search.css?lfllwz");
@import url("http://localhost/drupal/drupal-7.0/modules/user/user.css?lfllwz");
@import url("http://localhost/drupal/drupal-7.0/modules/ctools/css/ctools.css?lfllwz");
@import url("http://localhost/drupal/drupal-7.0/modules/views/css/views.c...p://local...");
@import url("http://localhost/drupal/drupal-7.0/themes/bartik/css/colors.css?lfllwz");
@import url("http://localhost/drupal/drupal-7.0/themes/bartik/css/print.css?lfllwz");
Skip to main content

(...)

katbailey’s picture

@moestavern, are you still testing this with the link example in ajax_example module? It works fine for me. If you're getting a 404 then that has nothing to do with jquery.form.js.

moestavern’s picture

Yes. I'm getting that last error when I additionally load js.form.query in the example. I'm new to Drupal, so I'm slightly at a loss to why this might happen. Any ideas where I could start looking?

rfay’s picture

See #1018714-19: Image Upload Widget Not Working in IE8. I think the problem will be solved when that one goes in. Am I right?

katbailey’s picture

@rfay it certainly sounds like it, judging by eff's description. I will test it this evening. If that is the case, there's nothing to be fixed in the ajax_example module. Though I do want to create the other type of link example. Will add that as a separate issue and assign it to myself.

katbailey’s picture

OK I can confirm that the patch in #1018714: Image Upload Widget Not Working in IE8 solves this problem without the need for any change in examples module itself.

I've submitted a patch for the renderable array link example at #1041526: Add a link example that uses a rendered array link instead of the use-ajax class.

rfay’s picture

Status: Active » Closed (duplicate)

Thanks katbailey!

Marking this as duplicate of #1018714: Image Upload Widget Not Working in IE8, as no further action seems to be required.

moestavern’s picture

just wanted to thank katbailey real quick. figured it all out with the help of the patched example. thanks!

jebbushell’s picture

Version: » 7.x-1.x-dev

I'm still getting it on the "use-ajax" example. I'm using 7.x-1.x-dev dated 2012-feb-20. The render array example is fine.