Get particular layout javascript and css - magento

Currently I am trying to get the "checkout_onepage_index" layout css and javascript in another page. How Can i get the javascript and css in a controller or observer. I want to get all the css and javascript that was loaded in checkout_onepage_index layout.

I don't know much using observer but you can defiantly do this using xml just copu your checkout.xml js code and paste it into another file of xml like "catalog.xml".

Related

Is there any way to change meta tag from the source code with vue js?

As you all know Vue js works in template. So it load the content the the page dynamically. so there is no way to change the meta tags manually. So there is a package called vue meta which is used to change the meta tags of the vue page dynamically. But the problem is when I change the meta tag dynamically It only changes in the inspect. But when I open the page source it isn't changing there.
you can see the meta tags in the inspector here
but there is no change in the page source
I even tried server side rendering for this. Is there any solutions??
Thanks in Advance

changing cakephp debug() html

The CakePHP framework executes the debug function by placing HTML on the view layer. I have implemented a new CSS but the HTML from the debug doesn't work so well with the CSS.
How can I change cake's default HTML to export customer HTML when the debug is executed?
You can't, just look at the source code, it's all hard coded.
https://github.com/cakephp/cakephp/blob/2.5.2/lib/Cake/basics.php#L73
https://github.com/cakephp/cakephp/blob/1.3.19/cake/basics.php#L126
So either adapt your CSS, or create your own debug function with custom HTML output.

AJAX: Django's templates flexibility gone? Update CSS & JS?

Leaving all the header/footer/nav parts of pages untouched,
refreshing only page's content with AJAX,
can't use base template extension's block mechanism to set content-corresponding styles, scripts, page title?
Wonder how to get .css and .js for updated content with AJAX?
In general, you will want to make all of your CSS and JS available in the header templates so that they are available when your dynamic content is loaded. The overhead is slight, and you will be following the "Django way."
Another option is to include inline CSS/JS in your dynamic content, but this approach is not recommended. It leads to messy code and can be difficult to troubleshoot.
Can't use full sentences?
Anyway, I have no idea why you think you need to get CSS and JS for partial pages. A set of HTML elements dynamically inserted via Ajax will simply use the existing CSS associated with the page.

Bootstrap collapse not working for content loaded via Ajax

I am new to Bootstrap. I am facing a problem which I am not able to figure out the reason. If I load a content dynamically the collapse is not working. It is not adding the class in on hover as in http://twitter.github.com/bootstrap/javascript.html#collapse but if the same html copied from dom and added as a static element the method is working. I am using ajax to load the content and in the complete function initializing the events. Any idea why the content don't expand on hover with ajax.
Call $(".collapse").collapse(); after contents are loaded dynamically.

Load html without refresh

Im unsure of how to approach this, should I have the html to be loaded hidden or load it from somewhere? I want to load a form in one page, and dynamic content on other pages.
The form can be saved to mongo db, and when the page loads should load the data into that form from mongo db.
Where does the html live for all the pages? I want to have a clean html5 document with lets say a content div. all content goes into that block.
Server running Django
Im want to use backbone.js for the app
any help would be appreciated
The initial page should include the basic layout of the application (header, content, sidebar, different placeholder for your views, etc.)
Then you load the application (usually with a controller) and render the different view that will replace the placeholders you had in your layout.
To render the views, I suggest to use a templating engine. With backbone.js there is already underscore.js on the page, so you can use the templating engine included (http://documentcloud.github.com/underscore/#template). You then have to load the template on the page. The easiest way is to create include a script element on the page with your template inside:
<script type="text/template" name="template1">
your template here...
</script>
And you can load it using this:
var template = _.template( jQuery("script[name=template1]").text() )
and execute with your data
var html = template(model)
You build your page with different backbone views using different template.
I hope that help!

Resources