Integrate third party library that generates a pricing page in Wix - velo

I'm trying to integrate a third party library that is meant to dynamically generate a pricing page in Wix
I need to reference the external script from a script tag, and then call a function that will add the content to a dom Node.
The code, on a regular HTML page, would be something like this:
<html>
<head>
[...]
<script src="https://js.test.library.com/pricing.test.js"></script>
</head>
<body>
<div id="pricing"></div>
<script>
Pricing.render('#pricing', 'PRICING_PAGE_CODE');
</script>
</body>
Pricing being the embedded library.
From the settings, Custom code option I could add the reference script, but I don't know how to execute it or get the reference to the DOM element where I want to render the pricing page.

Related

Attribute gwd-events not allowed on element script at this point

I was making a html5 banner using Google Web Designer and one of the technical requirements for the platform I make it for is haveing no Errors in https://validator.w3.org/ . The main error is
Attribute gwd-events not allowed on element script at this point.
What can I replace it with?
<script type="text/javascript" gwd-events="handlers">
<script type="text/javascript" gwd-events="support">
<script type="text/javascript" gwd-events="registration">
Honestly I don't know what can I try in this case, because the code in autogenerated by Google Web Designer and events are part of it.

CKEditor editable content in IFrame

Is it possible to run ckeditor on an IFrame so that can encapsulate a full html page? I have tried various methods but nothing seems to work.
What I am looking for is to have a ckeditor wrapper page say Editor.htm which contains an editable IFrame linked to my real html page say test.htm. Something line:
Editor.htm
<!DOCTYPE html>
<html>
<head>
<script src="http://cdn.ckeditor.com/4.5.10/standard-all/ckeditor.js"></script>
</head>
<body>
<iframe contenteditable="true" src="test.htm" id="editor1" name="editor1"></iframe>
</body>
</html>
You can set ckeditor to use "fullPage" mode, allowing you to edit everything from the opening tag to the closing tag. See the official sample here.
You will still need to get the content into the editor (e.g. the html page you want to edit) and save the result on the server, but this is something specific to your site, language, platform etc.

How to make fake paths for resources in asp.net mvc?

I am using asp.net mvc3. I have two script files on my web site like these:
<script type="text/jscript" src="/SiteName/lib/jquery/menus.js"></script>
<script type="text/jscript" src="/SiteName/lib/jquery/dialogs.js"></script>
These are real paths for these two .js files where the SiteName directory is on the root of my website.
Now when the site rendered, i want to be these pathes like:
<script type="text/jscript" src="/lib/jquery/menus.js"></script>
<script type="text/jscript" src="/lib/jquery/dialogs.js"></script>
As a result, the "SiteName" portion is deleted from the path! but really it is available!
Yet the browser must be able to load these scripts.
I think this must be done by routes.MapRoute or like these!
You can use BundleConfig to achieve this. You can create styles and script bundles that have a virtual path with the added benefit of minification. If you add multiple scripts into one bundle, it'll join and minify both into one virtual script. e.g.:
bundles.Add(new ScriptBundle("~/lib/jquery").Include(
"~/SiteName/lib/jquery/menus.js",
"~/SiteName/lib/jquery/dialogs.js"));
On page render, it'll show up as:
<script type="text/javascript" src="~/lib/jquery"></script>
From memory this wasn't there by default in MVC3, but it looks pretty easy to implement if you refer to this answer: https://stackoverflow.com/a/12754108/769083

How not to be confined into content area... full size web app on Joomla

I am currently creating an Intranet ERP application that will integrate an already existing corporate Joomla 3.1 based web site.
The extension i made so far only has one default controller php file and everything is made using a JavaScript UI framework. (i.e. jqWidgets) So i am not using model, views, helpers.
The other php files are there to respond to the client side interface AJAX requests.
So i mainly need Joomla for the user authentication and session control features but i dont want it to confine my extensions output to the content area... i need the entire document surface... no menu, no module columns, no nothing !
Can it be done ?
Two ways
component.php in the template will show only the component's output add &tmpl=component to your urls
Make a custom template that only outputs the component
<html>
<head>
<!-- put what scripts stylesheets you need etc//-->
</head>
<body>
<jdoc:include type="component" />
</body>
</html>

Ajax update in a Sharepoint 2010 Webpart

Is there any easy way to make a Ajax call in a Webpart?
I have a Webpart with a button, and I want that when the user pushes the button, it executes a server function without reloading the page. And then, if all is ok, execute a callback function. I thought that the best way is with a AJAX call.
But when I've looked for how to do it I only get some complicated tutorials that I don't really understand (and most are from old versions of Sharepoint). Any help? What is the best way to start? Thanks
Have you tried using jQuery with a content editor web part? I've done this before and it's rather easy. Here is a step by step for how I do it.
Download jQuery.
Upload jQuery to SiteAssets in Sharepoint.
Upload coded file (see below) with AJAX calls.
Point to coded file via Content Editor Web Part.
It should work!
Here is a default way something should work.
<html>
<head>
<script src="<point to jquery file>"></script>
<script type="text/javascript">
$(document).ready(function(){
$('#main').load('<RELATIVE URL TO SERVER PAGE>');
});
</script>
</head>
<body>
<div id="main"></div>
</body>
</html>
If possible I would go for a Visual Web Part in Visual Studio. You basically create a .NET user control. It saves you a lot of manual control definitions etc.
If in SharePoint2007 you might want to take a look at the "Smartpart". It has ajax support and some great tutorials on how to use it.

Resources