Bug Tracker

Ticket #4913 (closed bug: worksforme)

Opened 5 years ago

Last modified 4 years ago

Safari multiple class select fail on disconnected elements

Reported by: Larry Battle Owned by:
Priority: major Milestone: 1.4
Component: selector Version: 1.3.2
Keywords: plus, safari multiple selector, jquery code Cc:
Blocking: Blocked by:

Description (last modified by dmethvin) (diff)

I have one question and one problem.

Problem Safari fails when selecting multiple selectors|elements from variables that have not been attached to the DOM. Other browsers work just fine.

<div id="output"/>
var q = $( "<p/>" ).append(
		$( "<div/>" ).attr({"class": "input1", "id": "inputId1" }),
		$( "<div/>" ).attr({ "class": "input2", "id": "inputId2" }),
		$( "<div/>" ).attr({ "class": "input3", "id": "inputId3" })
	);

//The follow does not work in safari.
	$( ".input1, .input2, .input3", q ).html( "classes were found and..." );
	$( "#output" ).html( q.html() );
	$( "#inputId1, #inputId2, #inputId3" ).each(function( i, e ){
		$( e ).html("ids were found.");
		alert("Change");
	});

Question Does a plus in front of a variable do something special in javascript or is it there for a reminder or something?

Example. In jQuery 1.3.2 in the function eq, it has +i.

eq: function( i ) {
return this.slice( i, +i + 1 );
},

It's also in the now function. With return +new Date;

Thank you for your help.

Change History

comment:1 Changed 4 years ago by dmethvin

  • Component changed from unfiled to selector
  • Description modified (diff)
  • Summary changed from Safari multiple class select fail. Also was does plus mean? to Safari multiple class select fail on disconnected elements

The unary plus operator converts a value to a number, or to NaN if the value isn't a number. I'll leave the ticket open for the bug.

comment:2 Changed 4 years ago by snover

  • Status changed from new to closed
  • Resolution set to worksforme
Note: See TracTickets for help on using tickets.