Link to home
Start Free TrialLog in
Avatar of tomaugerdotcom
tomaugerdotcomFlag for Canada

asked on

MooTools Injection Parameters - Please Explain

MooTools element.inject(otherElement, param) appears to be backward.

Can someone please explain the logic to me? Or is it just back-assward?
<html>
  <head>
  <meta http-equiv="content-type" content="text/html; charset=windows-1250">
  <meta name="generator" content="PSPad editor, www.pspad.com">
  <title>MooTools DOM Manipulation Example</title>
  
  <style type="text/css">
  	#A1 { border:2px solid red; }
  	#A2 { border:2px solid green; }
  	#A3 { border:2px solid blue; }
  </style>
  
  <script type="text/javascript" src="lib/mootools.js"></script>
  <script type="text/javascript">
  function inject_1(){

  	var A1 = $('A1');
  	var A2 = $('A2');
  	var A3 = $('A3');
  	A1.inject(A2, 'after');
  }
  
  </script>
  
  </head>
  <body>
	<h1>MooTools DOM Injection / Manipulation Test</h1>
	<h2>Sample 1: Simple DOM Elements</h2>
	<div id="A1">A1 - First DIV</div>
	<div id="A2">A2 - Second DIV</div>
	<div id="A3">A3 - Third DIV</div>
	<button onclick="inject_1()">Inject A2 before A1</button>
  </body>
</html>

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of tomaugerdotcom
tomaugerdotcom
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial