This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

manipulating frame url by script
#7
Hi Erwin,

I added this code, but unfortunately the behaviour doesn't change. Without changing the object values (in lon, lat or zoom) the frame shows an old position on opening the page with this frame in it. 
When I open the page in edit mode the frames source URL is also the old one instead of the actual one.

It seems that the code changes the src (URL) only temporary.

Uwe

PS: the existing code:

Code:
$(function(){
 if (typeof grp != 'undefined') {
     var LON = grp.getvalue('10/4/2') || 0;
     var LAT = grp.getvalue('10/4/0') || 0;
     var ZOOM = grp.getvalue('10/4/3') || 15;
     $('.position').find('iframe').attr('src', 'http://osmand.net/go.html?lat=' + LAT + '&lon=' + LON + '&z=' + ZOOM);
 }
});

$(function(){
 if (typeof grp != 'undefined') {
   grp.listen('10/4/2', function(object, state) {
     var LON = grp.getvalue('10/4/2') || 0;
     var LAT = grp.getvalue('10/4/0') || 0;
     var ZOOM = grp.getvalue('10/4/3') || 15;
     $('.position').find('iframe').attr('src', 'http://osmand.net/go.html?lat=' + LAT + '&lon=' + LON + '&z=' + ZOOM)
   }, true);
 }
});

$(function(){
 if (typeof grp != 'undefined') {
   grp.listen('10/4/0', function(object, state) {
     var LON = grp.getvalue('10/4/2') || 0;
     var LAT = grp.getvalue('10/4/0') || 0;
     var ZOOM = grp.getvalue('10/4/3') || 15;
     $('.position').find('iframe').attr('src', 'http://osmand.net/go.html?lat=' + LAT + '&lon=' + LON + '&z=' + ZOOM)
   }, true);
 }
});

$(function(){
 if (typeof grp != 'undefined') {
   grp.listen('10/4/3', function(object, state) {
     var LON = grp.getvalue('10/4/2') || 0;
     var LAT = grp.getvalue('10/4/0') || 0;
     var ZOOM = grp.getvalue('10/4/3') || 15;
     $('.position').find('iframe').attr('src', 'http://osmand.net/go.html?lat=' + LAT + '&lon=' + LON + '&z=' + ZOOM)
   }, true);
 }
});
Reply


Messages In This Thread
manipulating frame url by script - by schippi - 04.02.2018, 18:50
RE: manipulating frame url by script - by schippi - 06.02.2018, 13:26

Forum Jump: