Titanium Community Questions & Answer Archive

We felt that 6+ years of knowledge should not die so this is the Titanium Community Questions & Answer Archive

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.

— asked October 22nd 2010 by Josh Lewis
  • open
  • openwindow
0 Comments

1 Answer

  • Is the "locations.js" in the same directory? or the Parent directory?

    — answered October 22nd 2010 by Peter Sawka
    permalink
    0 Comments
The ownership of individual contributions to this community generated content is retained by the authors of their contributions.
All trademarks remain the property of the respective owner.