Titanium JIRA Archive
Appcelerator Community (AC)

[AC-3087] Android: UI - Titanium is not defined in webView when url contains a hash

GitHub Issuen/a
TypeBug
Priorityn/a
StatusClosed
ResolutionNeeds more info
Resolution Date2011-12-22T19:33:33.000+0000
Affected Version/sn/a
Fix Version/sn/a
ComponentsTitanium SDK & CLI
Labelsvvsdf
ReporterJason Crider
AssigneePaul Dowsett
Created2011-10-31T12:33:15.000+0000
Updated2016-03-08T07:48:08.000+0000

Description

Problem

If I launch a URL in a webview that contains the hash mark (#) I can no longer use Titanium.App.addEventListener or Titanium.App.fireEvent.

Logs

The adb console returns the following error:
E/Web Console(31288): Uncaught ReferenceError: Titanium is not defined at file:///android_asset/Resources/windows/Neighborhood/webviews/map.html#hospitals|:51

Test case

//screenHeight/screenWidth being set in another file.
var web = Titanium.UI.createWebView({
    top:20,
    height: screenHeight-this.top,
    width: screenWidth,
    url: 'anyurl.html#data'
});
<!doctype html>
<html>
<head>
<title>Title</title>
<script type="text/javascript">
  Ti.App.addEventListener('someevent',function(data) {
alert(data.msg);
});
</script>
</head>
<body>
<p>content</p>
</body>
</html>
The same thing happens if I try to pass a query string to the url.

Comments

  1. Paul Dowsett 2011-12-22

    In order for me to escalate this ticket to the core team, it must follow the [JIRA Ticket Checklist](https://wiki.appcelerator.org/display/guides/How+to+Submit+a+Bug+Report#HowtoSubmitaBugReport-JIRATicketChecklist) and hence include a test case that runs without modification, as per the [Creating a Test Case](https://wiki.appcelerator.org/display/guides/How+to+Submit+a+Bug+Report#HowtoSubmitaBugReport-CreatingaTestCase), and full details in the environment field. I will close this for now. Please reopen the ticket once it is complete, and I will move it to the main project. Thanks for your efforts with this.
  2. Paul Dowsett 2012-02-17

    Closing due to inactivity. If this issue still exists, please raise a new ticket, including all the information in the [JIRA Ticket Checklist](https://wiki.appcelerator.org/display/guides/How+to+Submit+a+Bug+Report#HowtoSubmitaBugReport-JIRATicketChecklist) to ensure that we can escalate it quickly. Read [How to Submit a Bug Report](https://wiki.appcelerator.org/display/guides/How+to+Submit+a+Bug+Report) if you have not read it before, and always start a ticket using the [JIRA Ticket Template](https://wiki.appcelerator.org/display/guides/JIRA+Ticket+Template). Thanks in advance

JSON Source