Bug Tracker

Opened 14 years ago

Closed 13 years ago

#4555 closed enhancement (duplicate)

load has inconsistant behavior

Reported by: h3 Owned by:
Priority: minor Milestone: 1.4
Component: ajax Version: 1.3.2
Keywords: Cc:
Blocked by: Blocking:


Mostly every core functions can be ran without prior element verification.

So instead of;

if ($('#el').length) {



It's possible to just do;


We know that if "#el" is non-existent, the show method wont be called. So far so good.

But if we do this;


If #el is non-existent the Ajax request is performed anyway, thus making it mandatory to write something like this instead;

if ($('#el').length) {



In this regard, I think this behavior is counter intuitive and inconsistent with other functions.

There might be good reasons why one would want to perform a Ajax requests to load HTML into a non-existent element, but it's beyond my understanding.

Change History (2)

comment:1 Changed 14 years ago by dmethvin

Hmm, seems reasonable. Note that if a callback is provided in that case, it wouldn't be called.

comment:2 Changed 13 years ago by john

Resolution: duplicate
Status: newclosed

Duplicate of #4235.

Note: See TracTickets for help on using tickets.