Created
October 12, 2012 08:01
-
-
Save naiquevin/3877893 to your computer and use it in GitHub Desktop.
KodeCRM snippets
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.myKodecrmButton { | |
display: block; | |
background: #08C; | |
color: #fff; | |
padding: 5px; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- begin custom KodeCRM chat with us button --> | |
<a href="javascript:void(0);" id="kcrmBtn" class="myKodecrmButton">Chat with us!</a> | |
<!-- end custom KodeCRM chat with us button --> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(document).ready(function () { | |
var appid = '<Your appid>'; | |
var url = 'http://api.kodecrm.com/seller/'+appid+'/availability?callback=?'; | |
$.getJSON(url, [], function (data, textStatus, jqXHR) { | |
console.log(data, textStatus); | |
// do something with the data | |
}); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var kodecrmJsonp = function (resp) { | |
console.log(resp); | |
// do something with the data | |
}; | |
var appid = '<Your appid>'; | |
var elem = document.createElement('script'); | |
elem.type = 'text/javascript'; | |
elem.src = 'http://api.kodecrm.com/seller/'+appid+'/availability?callback=kodecrmJsonp'; | |
document.body.appendChild(elem); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment