I am trying to implement disqus suggestions in my ionic application. I know that I need to place it in a domain for which I am sure that I configured it correctly. Any help would be appreciated.
Here is the code in my app.js app for ionic app
$scope.showComments = function () { $scope.currentView = "comments"; //loadComments(params["shortname"], params["url"], params["title"], params["identifier"]); // var disqus_title = "Venue 1"; var disqus_identifier = '/venue/' + $stateParams.id; var disqus_url = 'liverpool.li/venue/' + $stateParams.id; var url = "http://liverpool.li/app/disqus.html?"; $scope.url = url + "shortname=liverpoolli&url=" + encodeURIComponent(disqus_url) + "&title=" + encodeURIComponent(disqus_title) + "&identifier=" + encodeURIComponent(disqus_identifier); $scope.url = $sce.trustAsResourceUrl($scope.url); }; $scope.$on("$destroy", function () { if ($scope.lastScriptElm && $scope.lastScriptElm.parentNode) { $scope.lastScriptElm.parentNode.removeChild($scope.lastScriptElm); $scope.lastScriptElm = null; } });
And the page pointed to (disqus.html) located in my domain
<!DOCTYPE html> <html> <head> <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"> </head> <body> <div id="disqus_thread"></div> <script type="text/javascript"> var params; var disqus_url; var disqus_title; var disqus_shortname; var disqus_identifier; window.onload = function () { var match, pattern = /\+/g, search = /([^&=]+)=?([^&]*)/g, decode = function (s) { return decodeURIComponent(s.replace(pattern, " ")); }, query = window.location.search.substring(1); params = {}; while (match = search.exec(query)) params[decode(match[1])] = decode(match[2]); if (params["shortname"] === undefined || params["url"] === undefined || params["title"] === undefined) { alert("Required arguments missing"); } else { loadComments(params["shortname"], params["url"], params["title"], params["identifier"]); } }; function loadComments(shortname, url, title, identifier) { disqus_url = url; disqus_title = title; disqus_shortname = shortname; if (identifier !== undefined) disqus_identifier = identifier; else disqus_identifier = ""; (function() { var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = false; dsq.src = 'http://' + disqus_shortname + '.disqus.com/embed.js'; (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq); })(); } </script> <noscript>Please enable JavaScript to view the <a href="http://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript> <a href="http://disqus.com" class="dsq-brlink">blog comments powered by <span class="logo-disqus">Disqus</span></a> </body> </html>
I get the following error
we were unable to load disqus. if you are a moderator, see our troubleshooting guide.
BCLtd source share