I only want highstock in my project, but if I put
"highcharts": "v4.0.4",
Then it will generate the link:
<script src="bower_components/highcharts/highcharts.js"></script>
but all I need is
<script src="/bower_components/highcharts/highstock.js"></script>
If I have both, then I will run into the Highchart error of duplicate definition.
How do you guys solve this issue?
Thanks
So the solution is that
I will first do "highcharts": "v4.0.4",
Then define the main file to include is highstock.js.
Related
With thymeleaf and following code
<script th:src="#{/js/init.js}"></script>
I would like to make it like following in order to avoid browser caching for this file
<script th:src="#{/js/init.js?${minute}}"></script>
${minute} will be current time minute.
Try:
<script th:src="#{/js/init.js(minute=${minute})}"></script>
Reference: Standard URL Syntax
I solve the question by use the following, it's a bit longer than expected.
<script th:src="#{/js/init.js(minute=${#dates.format(#dates.createNow(), 'mm')})}"></script>
If you just want to provide versioned static files, you might try spring resource versioning. One possible solution using configuration only is described here https://stackoverflow.com/a/49040930.
what means ${demo.css} in example files of highcharts ? That piece of code
<style type="text/css">
${demo.css}
</style>
seems to be literal
This looks like a jQuery template tag to load a non-existent CSS file. According to this Highcharts form post it is not required, and all configuration should be managed through Javascript rather than CSS.
The Highcharts API Reference lists all of the Javascript configuration items.
I'm trying to implement the bootstrap datepicker one of my forms. I've already tried these paths https://github.com/Nerian/bootstrap-datepicker-rails// github.com/lubieniebieski/bootstrap-datetimepicker-rails and the bootstrap css is not showing.
Currently I'm using this version https://github.com/lubieniebieski/bootstrap-datetimepicker-rails and have this /= require bootstrap-datetimepicker in my application.js and this #import 'bootstrap-datetimepicker'; in my boostrap_and_overidescss.scss. The following is my script:
<script type="text/javascript">
$(document).ready(function(){
$('#insurance_start_date').datepicker();
});
</script>
Any light onto this soul would be greatly appreciated!
If you just want a date picker, I think this has been upgraded to support BS3: https://github.com/eternicode/bootstrap-datepicker
If you want date and time, I think this is the one: https://github.com/Eonasdan/bootstrap-datetimepicker
I have not tried the latter because of some other frameworks that don't work yet (mostly simpleform), but these were what I came up with when I evaluated my upgrade path 2 weeks ago.
I'm working on the exact same gem you are, right now.
Not sure how much help I will be, though, but here's pointing out 2 things that may help.
1) It could be a typo, but your bootstrap_and_overrides.css.scss appears to have the improper file extension. yours seems to be missing a period between overides and css.
2) What I did with this, to get the bootstrap working, was to just import it into my application css layout directly using *= require bootstrap-datetimepicker. With that, I do have the bootstrap 'd calendar...although, I'm still having issues with getting the calendar to close after you've selected the date.
Good luck, hope this helps.
I am getting the said error
$(".column").sortable is not a function
I m trying to create sortable/movable divs in my code.
Issue is that if I m using a new project then the code is working fine, but when I try to run it in my project it gives me the said error..
Any idea??
Sounds like you have forgot to add your jquery-ui script library to the page. Add the following within the head section to see if it works.
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
<script src="//ajax.googleapis.com/ajax/libs/jqueryui/1.9.1/jquery-ui.min.js"></script>
I am trying to hide/show elements in a view using following code:
$('buttonClass/IDhere').click(function (){
$('theDivYouWantToShowClass/IDhere').toggle();
});
However, I am keep getting
Microsoft JScript runtime error: '$' is undefined
What might be the issue and how do I fix it?
This thread is pretty old, but I think an answer in the thread would be nice. I agree with the previous two answers - it's likely because jQuery wasn't loaded. You can load it this way (usually toward the top of the file):
<script src="~/Scripts/jquery-1.9.1.js" type="text/javascript"></script>
<script src="~/Scripts/jquery-1.9.1.min.js" type="text/javascript"></script>
(or whatever the current version of jQuery is).
Hope it helps.
It sounds like jQuery hasn't been loaded yet.
did you make sure download the jquery javascript file and link in to your html/aspx page before attempting to use jquery scripting?
you need to:
download the jquery code/file from:
http://jquery.com/
copy the file (jquery-1.8.3.min.js) you just downloaded somewhere into your web project directory/folder
then insert the link to this file into html/aspx page:
now try to run webpage
references:
www.youtube.com/watch?v=Bf9Gs-09uzQ
www.ajaxtutorials.com/javascript/introduction-to-jquery-learn-jquery-from-scratch-in-asp-net-4-0/
$ is defined by default when you load jquery. I would try and use jquery() to see if somehow $ is being unloaded etc. You can also load up firebug and hit the page. It should show up as a global variable/function. NOTE: You can also setup jquery to not setup the short hand "$".
since it looks like your trying to target classes and ID's - try this
$('.buttonClass #IDhere').click(function (){
$('.theDivYouWantToShowClass #IDhere').toggle();
});
This is a definite case of jQuery module not being loaded. In my case, common.js had a jQuery related script
$( document ).ready(function() {
var divSessionWarning = $("#idivWarn");
divSesWarning.load(divSesWarning.data("src"));
});
This was called in header.jsp. Swapping the sequence of loading the jQuery followed by the common.js resolved the issue.
<script language="javascript" type="text/javascript" src="/JAVASCRIPT/jquery/jquery-1.10.2.min.js"></script>
<script type="text/javascript" src="/JAVASCRIPT/mod/common.js"></script>
Hope this helps.
If jQuery is called then make sure jQuery is loaded before the stylesheet as its likely that calls it