Get twitter share response - twitter

I have to make a reward functionality for my customers.In this if any customer share, follow link of website then I have to store their details.Question Is that how can we get either user shared something or not.Any help would be appreciated.
I am using following code.
twitter.com/share?text=Your+Email+Marketing&url=http://blog.abc.com/your-email-marketing.html

I have found a solution using jquery.twitterbutton.js
code :-
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<script src="http://code.jquery.com/jquery-latest.pack.js" type="text/javascript"></script>
<script src="http://platform.twitter.com/widgets.js"></script>
<script src="jquery.twitterbutton.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function () {
$('#twitterbutton-example').twitterbutton({
user:'YourUsername',
title:'jQuery-Twitter-Button Plugin with callback functions',
onfollow:function(response){
$('.twitterbutton-uncontent:visible').hide('fade');
$('.twitterbutton-content').show('fade');
$.cookie('tw','followed');
},
ontweet:function(response){
alert("hello");
},
onretweet:function(response){
},
lang:'en'
});
});
</script>
</head>
<body>
<div id="twitterbutton-example"></div>
</body>
</html>

Related

How do I load and run jsPDF from a CDN without receiving an "import declarations" error?

I am wanting to experiment with the jsPDF library but I can't seem to get it to load.
From my Visual Studio MVC _Layout.cshtml page.....
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title></title>
</head>
<body>
<main role="main">
#RenderBody()
</main>
#RenderSection("Scripts", required: false)
</body>
</html>
From my Visual Studio MVC pdf.cshtml page...
#{
Layout = "~/Views/Shared/_Layout.cshtml";
}
<form id="form1">
<div class="btnExport">
<img id="pdfBtn" src="/images/pdf.jpg" style="height: 30px;" />
</div>
</form>
#section Scripts {
<script src="https://cdnjs.cloudflare.com/ajax/libs/jspdf/2.5.1/jspdf.es.min.js">
</script>
<script type="text/javascript">
const doc = new jsPDF();
$("#pdfBtn").click(function () {
doc.fromHTML($('#form1')[0], 15, 15, {
width: 170
}, function () {
doc.save('sample-file.pdf');
});
</script>
}
I am receiving the following error messages in the browser console...
I've tried several variations/combinations of the variable declaration (as taken from the documentation on the jsPDF GitHub site) but to no avail. Any assistance is greatly appreciated.

Redirect from mvc view to angular route - Angular 6

I have integrated my angular project with ASP.NET MVC. I want to redirect my MVC page to angular route on first load. I have following code in my Index.cshtml page
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Myapp</title>
<base href="/">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" type="image/x-icon" href="favicon.ico">
</head>
<body class="skin-blue sidebar-mini wysihtml5-supported">
<app-root></app-root>
<script type="text/javascript" src="~/Scripts/client/runtime.js"></script>
<script type="text/javascript" src="~/Scripts/client/polyfills.js"></script>
<script type="text/javascript" src="~/Scripts/client/styles.js"></script>
<script type="text/javascript" src="~/Scripts/client/vendor.js"></script>
<script type="text/javascript" src="~/Scripts/client/main.js"></script>
</body>
</html>
I also have the index.html page configurations in angular index page.
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Myapp</title>
<base href="/">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" type="image/x-icon" href="favicon.ico">
</head>
<body>
<app-root>
<div class="wrapper">
</div>
</app-root>
</body>
</html>
Now I need to redirect the page from here to angular route where login route is defined for angular.
{ path: 'login', component: LoginComponent },
You have everything needed for Angular to run from your cshtml file. No need for index.html file.
Try to add this to your route config.
{path:'', redirectTo:'login', pathMatch: 'full' }
Once you add this Angular should redirect to login route by default.

Why Jquery UI Slider not work inside magnificpopup in iphone and safari borwser?

I try to load jQuery Ui Slider in magnific popup.
it's work fine in windows browser but is not work in ios browser..
please help me solve out this question..
Here is Code :
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>jQuery UI Slider - Default functionality</title>
<link rel="stylesheet" href="//code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css">
<link rel="stylesheet" href="magnific-popup.css">
<script src="http://code.jquery.com/jquery-1.7.2.min.js"></script>
<script src="http://code.jquery.com/ui/1.8.21/jquery-ui.min.js"></script>
<script src="jquery.magnific-popup.js"></script>
<script src="jquery.ui.touch-punch.js"></script>
<script>
$(function() {
$('.mgnpop').magnificPopup({
type: 'inline',
closeOnContentClick: true,
callbacks : {
open : function(){
$( "#slider" ).slider();
}
}
});
});
</script>
</head>
<body>
click here
<div id="popup">
<div id="slider"></div>
</div>
</body>
</html>

IOS jQuery plugin to webview

i have downloaded a ganttChart library from here
(https://github.com/thegrubbsian/jquery.ganttView) and added to my application after that i have created a html file like this
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>TITLE</title>
<script language="javascript" type="text/javascript" src="jquery-1.4.2.js">
</script>
<script language="javascript" type="text/javascript" src="jquery-ui-1.8.4.js">
</script>
<script type="text/javascript" src="jquery.ganttView.js"></script>
<script language="javascript" type="text/javascript" src="date.js"></script>
<script language="javascript" type="text/javascript" src="data.js"></script>
<link type="text/css" href="jquery.ganttView.css" rel="stylesheet"/>
</head>
<body>
<div id="Pluginwrapper">
<div id="Plugincontainer"></div>
</div>
</body>
</html>
then i am loading this html file via webview like this
[webview loadRequest:[NSURLRequest requestWithURL:[NSURL fileURLWithPath:[[NSBundle
mainBundle] pathForResource:#"sample" ofType:#"html"] isDirectory:NO]]];
but webview doesn't show anything. please tell what i am missing?
The web view doesn't show anything because you haven't added any visible content to the page, just markup.
If you're looking for your plugin to generate you some output, you should look at it's example files.

jquery mobile + jquery ui and page transitions

I'd like a page transition effect like the "slide" transition on jqmobile, but with the option of dragging between one page and the other.
I have the transition I want using this plug in the problem is that this plug in needs jqmobile and my project uses jquery ui extensively so dropping jq ui is not an option. Is there any way the two libreries can coexist? (or any other solution to have this kind of transition)
Here is the working code for my two pages.
page1:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<link href="css/jquery.mobile-1.0b2.min.css" rel="stylesheet" type="text/css" />
<link href="css/jquery.mobile.pagination.css" rel="stylesheet" type="text/css" />
<script type='text/javascript' src='Js/Libs/jquery-1.6.2.min.js'></script>
<script type='text/javascript' src='Js/Libs/jquery.mobile-1.0b2.min.js'></script>
<script type='text/javascript' src='Js/Libs/jquery.mobile.pagination.js'></script>
</head>
<body>
PAGE1
<ul data-role="pagination">
<li class="ui-pagination-prev">Prev</li>
<li class="ui-pagination-next">Next</li>
</ul>
</body>
</html>
page 2:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<link href="css/jquery.mobile-1.0b2.min.css" rel="stylesheet" type="text/css" />
<link href="css/jquery.mobile.pagination.css" rel="stylesheet" type="text/css" />
<script type='text/javascript' src='Js/Libs/jquery-1.6.2.min.js'></script>
<script type='text/javascript' src='Js/Libs/jquery.mobile-1.0b2.min.js'></script>
<script type='text/javascript' src='Js/Libs/jquery.mobile.pagination.js'></script>
</head>
<body onload="">
<script type="text/javascript">
$('div').live('pageshow', function (event, ui) {
alert('This page was just hidden: ');
});
</script>
</body>
</html>

Resources