Regarding the internal link in the application in MONACA

Asked 2 months ago, Updated 2 months ago, 2 views

We are currently making an application for a site created by WordPress.

From the front page, I give the URL parameter to single.html and pull the corresponding JSON to display the article title and article text, but if there is an internal link in the article, I would like to stop the browser from standing up and display the data pulled by JSON in the app.

Do you have any good ideas?

I'm sorry for the rude question, but I appreciate your cooperation.

monaca onsen-ui

2022-09-30 11:45

1 Answers

I thought it might be effective to take away the action when a link is clicked by Javascript.

Here's how to use jQuery:

<script src="http://code.jquery.com/jquery-2.1.3.min.js"></script>
<script>
  $(document).on('click', 'a', function(e){
    location.href=$(e.currentTarget).attr('href');
    return false;
  });
</script>


2022-09-30 11:45

If you have any answers or tips


© 2022 OneMinuteCode. All rights reserved.