Embed JavaScript and let it use local CSS - javascript

I've created a simple html web page using bootstrap.
I've also created a "nice looking" form with Svelte that also uses bootstrap.
The svelte form is hosted on another server/domain. I embed it on my html page by placing a -Tag and than placing my custom html tag where I want to see it.
Embedding the form is no problem, technically everything works but: I would like to remove the bootstrap library from the component because otherwise I load bootstrap twice.
When I remove bootstrap from the form, it loses its style. Using the "refer" option in is no solution.
Do you have any idea how I can make the embeded form use the bootstrap css from the page that it is embeded on?

I just found out that the problem is the so called "Shadow DOM", which is used by Svelte. It protects the svelte component from being modified by global css.
At the moment there is no official way to disable the Shadow DOM :(

Related

Disabled jquery on a div to fix conflicting issues with Vue.js

I'm working on a Drupal project that imports JQuery on all its pages. We started to use Vue.js by injecting it directly in the HTML pages for the development of dynamic components (not for a SPA).
The problem is that we have JQuery UI that conflicts with Vue.js. It will directly modify all the inputs of Vue.js by readapting their styles.
Is it possible to disable JQuery UI on a particular div, which would contain Vue.js? Without having to disable it on the whole page, because our header has a burger menu that uses JQuery UI.
We found a fix to correct this conflict between Vue.js and JQuery. This method will not completely disable JQuery on a given scope, but will disable a behavior that we were having trouble with.
$('select').selectmenu("destroy")
More about the method destroy here:
https://api.jqueryui.com/selectmenu/#method-destroy

Change main content on a webpage using bootstrap

I am building a webpage using Bootstrap 3. I am trying to find the best way to change the main content of the side. I have a Header, left content and right content but I want to change the middle content by pushing a button without changing the surrounding elements. What would be the best thing to use to accomplish this. Is there some demos online that someone can point out? I have been trying to find some but without luck.
Bootstrap doesn't have that feature. First try to learn what bootstrap can do or can't, what bootstrap made for.
What you are trying to do is called templating. You can use php, ajax or other methods to dynamically add content to your content section of your template.
You have many ways to do that, maybe with jQuery .load() and maybe combined with HTML5 history API or some other framework...
But Bootstrap has nothing to do with that..
You can start reading about AJAX and DOM manipulation first, but here is some link you can use:
Dynamically Loading Content in Twitter Bootstrap Tabs
You cannot do that with boot strap that is just not what it's made for you can use either PHP or Ajax personally if you know PHP already and have everything set up for go with that because in my opinion Ajax sucks to learn and work with

JSF custom component missing auto generated JavaScript when used with Oracle ADF

am working on project, where custom JSF component is built and it is working fine in test *.jsp page.
But when this custom tag is used within ADF tag, it's not working. (in weblogic server)
<af:showDetailItem ......>
<af:panelGroupLayout ......>
<custom:customComp .... />
</af:panelGroupLayout.>
</af:showDetailItem>
Error Details: Custom tag is rendered properly. When ever I click on any button inside a custom component it won't work. I analyzed rendered output of jsp/adf page using firebug. I found auto generated JavaScript for custom components are missing.
Could anybody please point me out why the JavaScript for (only) custom tag is not loaded.
Check this reference this reference, I believe it should fix your problem

How to build a widget to embed in third-party websites using AngularJs?

I would like to create a angularjs widget that can be embedded in third-party websites with minimal code such as
<script src=mywidget.js type=...></script>
<div id="mywidgetContainer"></div>
or similar.
I found some resources such as this article for developing a widget using jquery http://alexmarandon.com/articles/web_widget_jquery/.
How would it be done using Angularjs? In what clever ways can angular features such as directives/views etc. be harnessed to this purpose? What are the gotcha's if any? Your thoughts/suggestions/opinions/experiences, please.
You should also keep in mind the possibility that the 3rd party website also uses angular,
and potentially a different version.
Check Multiple versions of AngularJS in one page
This is what seems to have worked for me. In the script I set the innerHTML property of the Container div to the angular view markup code. The key point is to use angular.$bootstrap to manually bootstrap the app after the page load. I did not see any particular value in creating a directive. A directive would need to be part of the view code that would still need to be assigned to the container using innerHTML.

jQuery Multipage/One-page system

I'd like to know how can I create a system using HTML, CSS and jQuery that simulates a multipage website using a single HTML page. One example of this feature is used in this website.
Is there a plugin to create this effect and transition?
the website link you have given here is actually a single page. There are many plugins to achieve what is happening there. one of them is
reveal.js it also has an online presentation creator present here
other one is impress.js but IE isnt supported

Categories

Resources