Hello,
This is my view:
This is how I open the view:
The function called on data-show:
If the first block of code (the view) is inside my index.html file - it works.
If I move the view to a separate html file (views/email.html) it throws the following error:
How can I make it work when the view is in a separate file?
This is my view:
<
div
id
=
"viewemail"
data-role
=
"view"
data-title
=
"Email"
data-layout
=
"main"
data-show
=
"email_loaded"
>
<
div
id
=
"email-subject"
></
div
>
<
div
id
=
"email-body"
></
div
>
</
div
>
This is how I open the view:
<
a
data-role
=
"button"
href
=
"#viewemail?emailId=5"
><
div
class
=
"row"
id
=
"5"
>Random Subject</
div
></
a
>
The function called on data-show:
function email_loaded(e) {
id = e.view.params.emailId;
$('#email-subject').text('Subject with id:'+id);
}
If the first block of code (the view) is inside my index.html file - it works.
If I move the view to a separate html file (views/email.html) it throws the following error:
GET http://local/Simulator/viewemail?emailId=5 404 (Not Found)
How can I make it work when the view is in a separate file?