chrisgrim
1 year ago

How To Add Variable Data To Javascript

Posted 1 year ago by chrisgrim

Hi,

I am trying to add laravel data to javascript.

Here is my javascript

function myFunction() {
      window.open("https:www.hereisurl.com");
};

I am trying to add the data $brand->url to the javascript but if I try

function myFunction() {
      window.open("{{$brand->url}}");
};

I get http://sitename.test/%7B%7B$brand-%3Eurl%7D%7D

Thanks!

Please sign in or create an account to participate in this conversation.