Skip to content

Instantly share code, notes, and snippets.

@brianpeiris
Created December 18, 2012 21:07
Show Gist options
  • Save brianpeiris/4332019 to your computer and use it in GitHub Desktop.
Save brianpeiris/4332019 to your computer and use it in GitHub Desktop.
Sample code for Adobe Air problem
<application xmlns="http://ns.adobe.com/air/application/2.7">
<id>examples.html.HelloAir</id>
<versionNumber>0.1</versionNumber>
<filename>HelloAir</filename>
<initialWindow>
<content>HelloAir.html</content>
<visible>true</visible>
<width>400</width>
<height>200</height>
</initialWindow>
</application>
<html>
<head>
<title>Hello Air</title>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript">
function appLoad(){
$(".partOptions").on("DOMNodeInserted", "option", function() {
alert('detected inserted option');
});
var i = 0;
$('button').click(function () {
alert('inserting option');
i++;
$('select').append('<option value="' + i + '">foo' + i + '</option>');
});
}
</script>
</head>
<body onLoad="appLoad()">
<h1>Hello Air</h1>
<button>add option</button>
<div class="partOptions">
<select>
<option value="0">foo0</option>
</select>
</div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment