Bug Tracker

Modify

Ticket #7304 (closed bug: wontfix)

Opened 3 years ago

Last modified 3 years ago

$("#Something").ready(/*someFunction*/) problem!

Reported by: Sojaner Owned by:
Priority: undecided Milestone: 1.5
Component: unfiled Version: 1.4.3
Keywords: ready comment Cc:
Blocking: Blocked by:

Description

I had some code like this at the beginning of my Javascript codes on a HTML code:

$("Something").ready(someFunction);

        $(document).ready(PageInit);

        function PageInit() {

I was checking something on my code, so I needed the first line to be disabled.

I did this:

$("Something").ready(/*someFunction*/);

In fact, I passed a comment to the ready method instead os a function...

It disabled all the codes on my page and the

$(document).ready(PageInit);

no more worked!

I guess that it may be a global bug and all the methods may be infected! So that would be much nicer if the methods detect that the object passed to them is a comment text (if it would be possible!).

Thanks a million for your great job.

Change History

comment:1 Changed 3 years ago by addyosmani

  • Keywords ready comment added
  • Status changed from new to closed
  • Resolution set to wontfix

If you need to comment out the first line, simply comment out the entire line and not the actual function being passed to ready - there's no reason just that part of the line should have this done. Using $().ready(handler) on something outside the scope of document/window is also generally not advised. Given the very low number of cases where I imagine this might be done, I'm marking as wontfix for now.

Please follow the  bug reporting guidlines and use  jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

View

Add a comment

Modify Ticket

Action
as closed
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.