Launching URLs from JSON data in the system browser - Apache Cordova

I am facing an issue with opening links from a JSON in the system browser on both Android and iOS devices.

The link generated by the function appears as: {{item.addressLink}}, instead of bit.ly/xyzxyz

Here is what I currently have:

<a href="#" ng-click="goToLink('{{item.addressLink}}')">
          <i ng-hide="item.noPhoneAndMap === 1 || item.noMap === 1" class="fa fa-map fa-2x"></i>
        </a>
        <a  href="#" ng-click="goToLink('{{item.link}}')">
          <i ng-hide="item.noGlobe === 1" class="fa fa-globe fa-2x"></i>
        </a>

The function itself looks like this:

$scope.goToLink = function (url) {
          window.open(url,'_system');
   }

Answer №1

give this a shot

<a href="#" ng-click="openLink(item.addressLink)">
      <i ng-hide="item.noPhoneAndMap === 1 || item.noMap === 1" class="fa fa-map-marker fa-2x"></i>
    </a>
    <a  href="#" ng-click="openLink(item.link)">
      <i ng-hide="item.noGlobe === 1" class="fa fa-globe fa-2x"></i>
    </a>

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Find your favorite artist on Spotify through the search function

Recently, I stumbled upon this intriguing demo showcasing how to search for an artist using the Spotify API. However, despite several attempts, I have been unable to make it function properly. Can anyone provide any tips or guidance on making this work suc ...

The conceal feature doesn't appear to be functioning properly on jQuery Mobile

I am facing an issue with a small mobile app built using jQuery Mobile. Within a div, I have three buttons and other content. My goal is to hide these three buttons if the user's device is running on Windows (WP). The buttons are defined as follows: ...

Troubleshooting problem in Java related to encoding with XMLHttpRequest

Currently, I am utilizing XMLHttpRequest for an ajax call to my server. Let's consider the call: http = new XMLHTTPRequest(); var url = "http://app:8080/search.action?value=ñ" http.open("GET",url,true); http.setRequestHeader("Content-type", "applica ...

Creating a unique chrome extension that swaps out HTML and JavaScript components

Is there a possibility to create a Chrome extension that eliminates the JavaScript and CSS from a website while it loads, replacing them with new scripts from a separate source? For example, changing 'Old script' to 'new script', or &a ...

streamlining form updates in vue

The code snippet provided is functional but unnecessarily complicated and lengthy. I am seeking a more efficient approach to achieve the desired outcome. <h6><label for="number">Change Number</label></h6> ...

In JavaScript, use the href property to redirect to an external URL and then automatically scroll to a specific class on the page

I have a specific scenario where I need to create a link that redirects to an external website, of which I do not own. However, I am aware that there is a div with a particular class located at the bottom of their page, linking to an article. My goal is to ...

Add several web addresses to Pocket (or Instapaper)

As I attempt to transfer my old starred items from Google Reader to Pocket, I have successfully converted a JSON file containing all the URLs into a simple text file following guidance from PaulProgrammer on Stack Overflow. Now, the challenge lies in how t ...

My content is being obstructed by a single-page navigation system

I attempted to create a simplified version of the issue I am facing. Basically, I am working on a header with navigation that stays at the top of the page while scrolling. The problem arises when clicking on a section in the navigation. The screen scrolls ...

Executing a JavaScript function when an element is clicked using inline

Is it possible to write the code below in a single line? <a href="#" onClick="function(){ //do something; return false;};return false;"></a> As an alternative to: <a href="#" onClick="doSomething(); return false;"></a> functio ...

Transforming functions with dependencies into asynchronous operations with the help of promises

Can I convert both of my functions into asynchronous functions, even though one function relies on the other? Is it feasible for function b to execute only after function a? ...

What could be the reason for receiving a 400 Bad Request error when sending a JSON payload through the int-http:outbound

What is the reason for getting a 400 Bad Request error when using JSON payload for int-http:outbound-gateway? The request below works fine on Chrome Rest Client with three specified headers in inObjgateway and JSON value of Obj. public class Obj { @J ...

JavaScript and DOM element removal: Even after the element is removed visually, it still remains in the traversal

Our goal is to enable users to drag and drop items from a source list on the left to a destination list on the right, where they can add or remove items. The changes made to the list on the right are saved automatically. However, we are encountering an iss ...

When render returns another component, React does not invoke componentWillMount

Here is my code setup: const Dashboard = React.createClass({ getInitialState(){ return { user: JSON.parse(localStorage.getItem('user')) }; }, componentWillMount(){ var self = this; $.get({ url: 'http://127 ...

What causes an error when trying to access with the member access operator?

When dealing with object properties in the code snippet below, an error is thrown when trying to access the object using the Member Access. Why does this happen? var d = {a: 10, b: 20, c:30}; var keys = Object.getOwnPropertyNames(d); ...

The JavaScript library known as Microsoft JScript Angular is not recognized

While integrating Angular into my .Net MVC website, I keep running into a runtime error that reads as follows: 0x800a1391 - Microsoft JScript Runtime Error: 'angular' is undefined. This essentially means that the 'angular' object ...

Unraveling the complexities of double-encoded UTF-8 in PHP

Trying to transmit data from an HTML page via Ajax to a PHP page. This is the jQuery code I'm using: $.ajax({ url: "test.php", type: "POST", data: { name: "João" } }).done(function (data) { alert(data); }) When sending ...

Harmonizing database with AJAX-powered webpage

When using ajax calls to update data on a web page, what is the most effective way to synchronize changes with a database? For example, if I have a comment form that needs to work asynchronously. I write JS code to submit the form data to the database, but ...

There was a RangeError encountered while using the Google Maps directions service with the angular2 framework. The issue may be related to

I need help with an error I am encountering while using the maps directions service. I am facing a problem with implementing the Google Maps directions service with ng-2 and SebastianM/angular2-google-maps. I have done thorough research but can't seem ...

Utilizing UI Bootstrap Pagination with ng-repeat to enhance the user experience of navigating through a dynamically generated table

Struggling with incorporating pagination into my Angular app using uib-pagination. I can't seem to figure out the correct approach. HTML <table id="mytable" class="table table-striped"> <thead> <tr class="table-head"> & ...

Can a single file in NextJS 13 contain both client and server components?

I have a component in one of my page.tsx files in my NextJS 13 app that can be almost fully rendered on the server. The only client interactivity required is a button that calls useRouter.pop() when clicked. It seems like I have to create a new file with ...