Can't open .js file with a button. Why not?
Here is my code. Basically, I have a button that I want to load a .js file that I have built.
All of the resources, file paths, etc etc is fine.
//Button goes here
var editSavedButton = Titanium.UI.createButton({
title:'Edit Locations',
height:40,
width:200,
top:60
});
editSavedButton.addEventListener("click", function(e) {
alert('Loading location.js');
var newWindow = Titanium.UI.createWindow({
url:'locations.js',
title:'New Window'
});
Titanium.UI.currentTab.open(newWindow);
});
win1.add(editSavedButton);
//END button
If I take out everything EXCEPT the alert inside the button event, it fires. If I leave it in, nothing happens.
1 Answer
-
Is the "locations.js" in the same directory? or the Parent directory?