Skip to main content
Participant
June 3, 2019
Answered

Links in interactive map not working

  • June 3, 2019
  • 1 reply
  • 501 views

I am trying to create an interactive map for our website to show infrastructure updates to our various locations. I have different buttons, however, I copy and pasted each button type. I have figured out how to link it but only one of each time of button works and it opens all the pages instead of just that specific facility's update page. Can someone help me???

Example of three of the facility button's code:

var _this = this;

_this.correctional.on('click', function(){

window.open('http://doc.ok.gov/bjcc-updates', '_blank');

});

var _this = this;

_this.correctional.on('click', function(){

window.open('http://doc.ok.gov/jccc-updates', '_blank');

});

var _this = this;

_this.correctional.on('click', function(){

window.open('http://doc.ok.gov/wskcc-updates', '_blank');

});

This topic has been closed for replies.
Correct answer GoryGreg

Hi,

trying changing the instances of each button to be different i.e. first button called 'correctional1', second button 'correctional2' and third button 'correctional3' like this...

var _this = this;

_this.correctional1.on('click', function(){

window.open('http://doc.ok.gov/bjcc-updates', '_blank');

});

var _this = this;

_this.correctional2.on('click', function(){

window.open('http://doc.ok.gov/jccc-updates', '_blank');

});

var _this = this;

_this.correctional3.on('click', function(){

window.open('http://doc.ok.gov/wskcc-updates', '_blank');

});

Hope I have picked you up right and this works.

1 reply

GoryGregCorrect answer
Inspiring
June 3, 2019

Hi,

trying changing the instances of each button to be different i.e. first button called 'correctional1', second button 'correctional2' and third button 'correctional3' like this...

var _this = this;

_this.correctional1.on('click', function(){

window.open('http://doc.ok.gov/bjcc-updates', '_blank');

});

var _this = this;

_this.correctional2.on('click', function(){

window.open('http://doc.ok.gov/jccc-updates', '_blank');

});

var _this = this;

_this.correctional3.on('click', function(){

window.open('http://doc.ok.gov/wskcc-updates', '_blank');

});

Hope I have picked you up right and this works.

kayt2185Author
Participant
June 3, 2019

That worked!! Thank you!!! Now to just figure out how to publish it on my website. I need the source information to put in the code template. I tried cmd U in firefox but that didn't work.