iframe src not changing on button click in Django - django

In my web page Im using published map from Geoexplorer in iframe src.On button click I want to load another service in same iframe but its not working.
my html code in map.html is
<!DOCTYPE html>
<html>
<head>
</head>
<body>
<nav>
<button type="button" onclick="go()">Actual plant functional type</button>
</nav>
<section>
<iframe id="test" style="border: none;" height="494" width="1100" src="http://localhost:8080/geoexplorer/viewer/#maps/1"></iframe>
</section>
<script type="text/javascript">
function go() {
document.getElementById("test").src = "http://localhost:8080/geoexplorer/viewer/#maps/2";
}
</script>
</body>
</html>

Related

How to embedded google trends in to div

Once page load google tends graph is getting load under trendsBlock class. In below code once after calling next_fun() complete html code getting render with graph. I need to render inside of trendsBlock.
<html>
<body>
<script type="text/javascript" src="https://ssl.gstatic.com/trends_nrtr/1173_RC01/embed_loader.js"></script>
<div class="trendsBlock">
<script type="text/javascript">
trends.embed.renderExploreWidget("TIMESERIES", {"comparisonItem":[{"keyword":"dbs bank","geo":"IN","time":"2016-10-02 2017-11-02"},{"keyword":"citi bank","geo":"IN","time":"2016-10-02 2017-11-02"}],"category":0,"property":""}, {"exploreQuery":"date=2016-10-02 2017-11-02,2016-10-02 2017-11-02&geo=IN&q=dbs%20bank,citi%20bank","guestPath":"https://trends.google.com:443/trends/embed/"});
</script>
</div>
<button onclick="next_fun()">Click to next trends</button>
<script type="text/javascript">
function next_fun(){
//innerHTML in to class trendsBlock
//?
}
</script>
</body>
</html>
The renderExploreWidgetTo method allows one to embed the charts to any HTML element.
You can look at the below sample code to understand.
function next_fun(){
var divElem = document.getElementById('sampDiv');
trends.embed.renderExploreWidgetTo(divElem,"TIMESERIES", {"comparisonItem":[{"keyword":"dbs bank","geo":"","time":"today 12-m"}],"category":0,"property":""}, {"exploreQuery":"q=dbs%20bank&date=today 12-m","guestPath":"https://trends.google.com:443/trends/embed/"});
}
<html>
<body>
<script type="text/javascript" src="https://ssl.gstatic.com/trends_nrtr/1328_RC04/embed_loader.js"> </script>
<div id='sampDiv'>
</div>
<button onclick="next_fun()">Click to next trends</button>
</body>
</html>
P.S: when I am running the above code in StackOverflow's internal compiler/browser it throws an error.
Error img!!
But works fine otherwise.

Play audio from remote Url in Ionic(Hybrid app Development using cordova)

I am new to both Ionic and Cordova. I'm creating a basic app where I'll have some URLs of audio files that I want users to be able to play.
These URLs are fetching from web service. Please help me with this query. Thanks.
Edited after trying your answer:
following is the web service response. There is multiple event.Each event has two different audio that I want to play in one section.
{
"message":"success",
"title":"Panchkavani",
"error_msg":"",
"result":[
{"events_id":null,
"image":"",
"title":"test pachkavani",
"stanak":"https://ionic-audio.s3.amazonaws.com/Message%20in%20a%20bottle.mp3",
"mandir":"https://ionic-audio.s3.amazonaws.com/Roxane.mp3","date_added":"Saturday, 13-May-2017","date_time":"01:49 AM"}]}
here is a sample . dont forget to install cordova plugin add org.apache.cordova.media for more https://www.thepolyglotdeveloper.com/2014/11/playing-audio-android-ios-ionicframework-app/.this sample slso works only if you add media plugin
angular.module('ionicApp', ['ionic', 'ionic-audio'])
.controller('MyCtrl', function($scope) {
$scope.tracks = [
{
url: 'https://ionic-audio.s3.amazonaws.com/Message%20in%20a%20bottle.mp3',
artist: 'The Police',
title: 'Message in a bottle',
art: 'https://ionic-audio.s3.amazonaws.com/The_Police_Greatest_Hits.jpg'
},
{
url: 'https://ionic-audio.s3.amazonaws.com/Roxane.mp3',
artist: 'The Police',
title: 'Roxane',
art: 'https://ionic-audio.s3.amazonaws.com/The_Police_Greatest_Hits.jpg'
}
];
});
<html ng-app="ionicApp">
<head>
<meta charset="utf-8">
<meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no, width=device-width">
<title>Ionic Pull to Refresh</title>
<link href="//code.ionicframework.com/nightly/css/ionic.css" rel="stylesheet">
<script src="//code.ionicframework.com/nightly/js/ionic.bundle.js"></script>
<script src="https://rawgit.com/arielfaur/ionic-audio/master/dist/ion-audio.js"></script>
</head>
<body ng-controller="MyCtrl">
<ion-header-bar class="bar-positive">
<h1 class="title">Audio tracks with embedded bar</h1>
</ion-header-bar>
<ion-content>
<div class="list">
<ion-audio-track ng-repeat="track in tracks" track="track">
<div class="card">
<div class="item item-thumbnail-left">
<img src="{{track.art}}">
<h2>{{track.title}}</h2>
<p>{{track.artist}}</p>
<ion-audio-controls>
<a class="button button-icon icon" ion-audio-play></a>
<ion-spinner icon="ios" style="position: relative; top: 8px; left: 4px"></ion-spinner>
</ion-audio-controls>
</div>
<div class="item item-divider">
<ion-audio-progress-bar display-time></ion-audio-progress-bar>
</div>
</div>
</ion-audio-track>
</div>
</ion-content>
</body>
</html>

Off-canvas conflict with cover background images

I'm using some background images with background-size: cover;. It was running ok until I added the Foundation's off-canvas-menu. The background images aren't displayed in Chrome.
Any idea of how to fix this?
Thanks!
It's a problem with backface, probably on Chrome side. You can overwrite it with the following css code
.off-canvas-wrap, .inner-wrap {
-webkit-backface-visibility: visible;
}
I'm sorry, I thought that it maybe was a common issue. The problem is only in Chrome and Opera. I didn't try IE. Here is the code:
<!DOCTYPE html>
<html>
<head>
<title>Test canvas</title>
<link rel="stylesheet" href="css/foundation.css" />
<style>
.fondo-imagen-bn{
height:1000px;
background: url(img/foto-fondo-secciones.jpg) no-repeat center center fixed;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
}
</style>
</head>
<body>
<div class="off-canvas-wrap" data-offcanvas>
<div class="inner-wrap">
<a class="left-off-canvas-toggle show-for-small-only" href="#" >Off Canvas Menu</a>
<aside class="left-off-canvas-menu">
<ul>
<li>Item 1</li>
<li>Item 2</li>
</ul>
</aside>
<section class="fondo-imagen-bn">
<h1>Example with cover background</h1>
</section>
<footer style="height:300px;">
<h2>footer</h2>
</footer>
<a class="exit-off-canvas"></a>
</div>
</div>
<script src="js/vendor/jquery.js"></script>
<script src="js/foundation.min.js"></script>
<script src="js/foundation/foundation.js"></script>
<script src="js/foundation/foundation.offcanvas.js"></script>
<script src="js/scripts.js"></script>
<script>
$(document).foundation();
</script>

cannot work dropdown component in foundation 5

all. I'm new to foundation.
I tried to make a dropdown example, but it didn't work at all.
--all.scss--
.test{
#drop2{
#include dropdown-container;
}
}
--test.html--
<!DOCTYPE html>
<html>
<head>
<meta charset='utf-8'>
<meta content='IE=edge,chrome=1' http-equiv='X-UA-Compatible'>
<title>test</title>
<meta content='' name='description'>
<meta content='width=device-width, initial-scale=1.0' name='viewport'>
<link href='css/all.css' rel='stylesheet' type='text/css'>
</head>
<body>
<div class="test">
<a data-dropdown='drop2' href='#'>Has Content Dropdown</a>
<div class='f-dropdown content' data-dropdown-content id='drop2'>
<p>
Some text that people will think is awesome!
Some text that people will think is awesome!
Some text that people will think is awesome!
</p>
</div>
</div>
<script src='js/modernizr.js' type='text/javascript'></script>
<script src='js/jquery.js' type='text/javascript'></script>
<script src='js/fastclick.js' type='text/javascript'></script>
<script src='js/foundation.js' type='text/javascript'></script>
<script src='js/foundation.dropdown.js' type='text/javascript'></script>
<script type='text/javascript'>
$(document).foundation();
</script>
</body>
</html>
The browser shows the text "Has Content Dropdown", but nothing happens when I click the link.
I wonder that I must misunderstand how to use the dropdown component, but can't find what is wrong.
What's wrong with the program? Please help.
foundation 5.4.6
using Middleman and sass

Facebook connect button not showing up with django-allauth

Using this template
<!DOCTYPE html>
<html>
<head>
{% load socialaccount %}
<title></title>
</head>
<body>
{% providers_media_js %}
</body>
</html>
This html is generated
<!DOCTYPE html>
<html>
<head>
<title></title>
</head>
<body>
<div id="fb-root"></div>
<script type="text/javascript" src="/static/facebook/js/fbconnect.js"></script>
<script type="text/javascript">
allauth.facebook.init({ appId: '133560690071122',
locale: 'en_US',
loginOptions: {"scope": ""},
loginByTokenUrl: '/accounts/facebook/login/token/',
channelUrl : 'http://localhost:8000/accounts/facebook/channel/',
cancelUrl: '/accounts/social/login/cancelled/',
logoutUrl: '/accounts/logout/',
errorUrl: '/accounts/social/login/error/',
csrfToken: '0XAY1DNSymUReeSWlhj7rSbFSMToNmt8' });
</script>
</body>
</html>
However the facebook connect box is not showing up at all.
The javascript file is accessible and no js errors seem to be reported.
Any help would be highly appreciated :)
Just found out what I was missing:
Facebook Connect