Skip to content

Instantly share code, notes, and snippets.

<!-- TestWsCallout.page -->
<apex:page controller="TestWsCallout" tabstyle="Account">
<apex:form >
<apex:actionFunction action="{!InsertRecord}" name="InsertRecord_JS" Rerender="statuses" status="Status1" oncomplete="CallWebService_JS();"/>
<apex:actionFunction action="{!CallWebService}" name="CallWebService_JS" status="Status2" reRender="statuses, msg"/>
<apex:outputPanel id="statuses">
<apex:actionStatus id="Status1" startText="...Inserting Record Into DB..." />
<apex:actionStatus id="Status2" startText="...Calling Web Service..." />
</apex:outputPanel>
public class DynamicTabsCntl {
@AuraEnabled
public static List< foolish__TabsOnLightningComponent__mdt > getData () {
return [SELECT Id, foolish__ComponentName__c , DeveloperName, MasterLabel, foolish__IsActive__c ,foolish__Params__c
FROM foolish__TabsOnLightningComponent__mdt WHERE foolish__IsActive__c = true];
}
}
/*Source :
https://gomakethings.com/getting-all-query-string-values-from-a-url-with-vanilla-js/
*/
/* @param {String} url The URL
* @return {Object} The URL parameters
*/
var getParams = function (url) {
var params = {};
var parser = document.createElement('a');
<aura:component>
<!--- Your component -->
</aura:component>
let express = require ('express');
let express_graphql = require('express-graphql');
let {buildSchema} = require ('graphql');
//GraphQL schema
var schema = buildSchema (`
type Query {
message : String
}
let express = require ('express');
let express_graphql = require('express-graphql');
let {buildSchema} = require ('graphql');
//GraphQL schema
var schema = buildSchema (`
type Query {
course(id: Int!): Course
courses(topic: String): [Course]
$.getScript( "https://www.google.com/recaptcha/api.js?onload=onloadCallback&render=explicit" )
.done(function( script, textStatus ) {
console.log( textStatus );
})
.fail(function( jqxhr, settings, exception ) {
$( "div.log" ).text( "Triggered ajaxError handler." );
});
var lastHeight = 0, curHeight = 0, iframe = $('.recaptchaFrame');
iframe = iframe[0];
setInterval(function(){
// for lwciframe.style.height = iframe.contentWindow.document.body.scrollHeight + 'px';
curHeight = $frame.contents().find('body').height();
if ( curHeight != lastHeight ) {
$frame.css('height', (lastHeight = curHeight) + 'px' );
}
},500);
var path = $A.get("$Resource.sampleScript");
var req = new XMLHttpRequest();
req.open("GET", path);
req.addEventListener("load", $A.getCallback(function() {
$A.createComponent ('aura:unescapedHTML', {value: req.response},
function(newComp, status, errorMessage ) {
if (status === 'SUCCESS') {
component.set ('v.scriptDataComp',newComp );
}
});
<apex:page showHeader="false" applyBodyTag="false">
<apex:includeScript value="{!$Resource.jQuery_3_1_1}"/>
<script src='{!$Setup.foolish__reCaptcha__c.foolish__libraryUrl__c}?onload=onloadCallback&render=explicit' type="application/javascript"/>
<style>
body, div{
background:transparent !important;
}
html {overflow:hidden;}
.recaptcha {
transform: scale(0.74);