|
hi. well if you can help me out, need one on one help, show me how to do a better way of things, and also add extra features, and a free web server. marvin.
|
|
|
|
|
You should do some work on this post...
It is next to impossible to read it - no breaks, no sentences...It remembers me the The Caine Mutiny of Herman Wouk, that the very first time I got a copy where there were no white-space at all (I still wonder how it got to the library)...
Skipper: We'll fix it.
Alex: Fix it? How you gonna fix this?
Skipper: Grit, spit and a whole lotta duct tape.
|
|
|
|
|
Questioner is blind, so the chances are that the post was written by machine.
|
|
|
|
|
I have many DIV based contents in a page with a dropdown list. Right now, it shows everything, but, I want to choose an item from the dropdown list and it show the corresponding content based on the selection.
Please make a correction to the function I'm using since it's not working:
function toggleDIvDisplay() {
var index = document.getElementById("App").selectedIndex.value;
alert(index);
var x = document.getElementById("maxLenght").value;
for (i = 0; i < x; i++) {
if(null != document.getElementById(i))
document.getElementById(i).style.visibility='block';
}
document.getElementById(index).style.visibility='visible';
}
|
|
|
|
|
Member 11826602 wrote: document.getElementById(i).style.visibility='block';
There's no such values a "block" for visibility - it's a display property.
Assuming you want to maintain the spacing on the page as you change views, you want to swap between visibility = 'hidden' and 'visible'.
Here's some quick help: http://www.w3schools.com/cssref/pr_class_visibility.asp[^]
"The difference between genius and stupidity is that genius has its limits." - Albert Einstein | "As far as we know, our computer has never had an undetected error." - Weisert | "If you are searching for perfection in others, then you seek disappointment. If you are seek perfection in yourself, then you will find failure." - Balboos HaGadol Mar 2010 |
|
|
|
|
|
|
i want java source code for the employee attendance...........
|
|
|
|
|
This is a forum for programmers; you can get help here on this forum if you have any questions over how to do something using JavaScript.
We do not give away software for others to sell. If you want Java (or JavaScript, that's two different things) I suggest you hire a developer.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
Member 12178393 wrote: i want java source code for the employee attendance What does that even mean? Do you think there is only one way to make an employee attendance application?
Anyway, no, this site does not work that way. If you are stuck on a specific code issue please come back and ask and we'll gladly help.
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
|
making a menu I want to have the option of the current year, the 2 proceeding it and the next one...
this very very simple bit of code does the job well, I'm just wondering if there's any reason I should use an array instead of separate variables or if I'm breaking any other good practice rules...
<script>
d = new Date();
c = d.getFullYear();
a = c - 2;
b = c - 1;
d = c + 1;
</script>
and then further down, the menu
<ul>
<li><script>document.write('<a class="btn" href="report.php?y=' + a + '">' + a + '</a>');</script></li>
<li><script>document.write('<a class="btn" href="report.php?y=' + b + '">' + b + '</a>');</script></li>
<li><script>document.write('<a class="btn" href="report.php?y=' + c + '">' + c + '</a>');</script></li>
<li><script>document.write('<a class="btn" href="report.php?y=' + d + '">' + d + '</a>');</script></li>
</ul>
|
|
|
|
|
It's neither here nor there if you store the numbers in variables or use them in-line, however your choice of variable names is definitely against good practice. Call your variables things like previousYear, thisYear and nextYear.
If you're looking to try new things you could also use a "for" loop to write your links rather than doing it as you are. That way you can alter how many years back\forward you display rather than having to show four.
|
|
|
|
|
heh, wasn't too fussed about conventions like variable naming, was more interested in if there's any reason why declaring and assigning variables like that and then just referencing them in the spot I needed would be bad practice. I think if I was gonna make a loop for it, I'd change the page from being html to php, was really just a quick exercise in me just trying to keep it simple and keep the page html rather than php
|
|
|
|
|
I want to display specific fields from an external CSV file on a web site with using JavaScript. I tried to parse that file with using "Papa parse" like this: JSBin Link
<!DOCTYPE html>
<html >
<head>
<meta charset="UTF-8">
<title>Parse remote CSV to HTML Page</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
</head>
<body>
<script src='http://d3js.org/d3.v3.min.js'></script>
<script src='https://code.jquery.com/jquery-2.1.4.min.js'></script>
<script src='https://cdnjs.cloudflare.com/ajax/libs/PapaParse/4.1.2/papaparse.min.js'></script>
<script src='https://cdnjs.cloudflare.com/ajax/libs/mustache.js/2.2.0/mustache.min.js'></script>
<script>
Papa.parse("https://dl.dropboxusercontent.com/s/wsnizh4lyugxd60/data.csv", {
download: true,
header: true,
complete: function(results) {
console.log(results);
var data = results.data;
var arrayLength = data.length;
for (var i = 0; i < arrayLength; i++) {
var newdiv = document.createElement('div');
newdiv.setAttribute('id', 'csvdata'+i.toString());
newdiv.innerHTML = 'Battery Level: '+data[i].batteryLevel.toString();
}
}
});
</script>
</body>
</html>
How can I display a specific data from this data set in a web site like:
Battery Level: 0.62
Altimeter Pressure: 99.44185
Horizontal Accuracy: 65
Can you give me an example in JSBin or JSfiddle?
|
|
|
|
|
Dear All,
I got a question!
why can't i put the script code after the div with class="jumbotorn" ?
I have tried to put it in the , and it's work!
Please helps me!
THANKS!
<body>
<div class="jumbotron">
<div align="center">
<h1 style="font-family:微軟正黑體;">行銷神語</h1>
<p id="pharse"></p>
<p><a class="btn btn-primary btn-lg" href="#" role="button">Learn more</a></p>
</div>
</div>
<script>
function makePharse(){
var word1 = ["24/7","Multi-Tier","30,000 foot","B-to-B","Win-Win","Customer"];
var word2 = ["Empowered","Value-Added","Oriented","Focused","Aligned"];
var word3 = ["Process","Solution","Tipping-Point","Strategy","Vision"];
var rand1 = Math.floor(Math.random()*word1.length);
var rand2 = Math.floor(Math.random()*word2.length);
var pharse = word1[rand1]+""+word2[rand2]+"";
var pharseElement = document.getElementById("pharse");
pharseElement.innerHTML = pharse;
pharseElement.innerHTML = "TESt";
}
</script>
</body>
|
|
|
|
|
I do not agree that your script will work inside the head.
makePharse() is a function that you have to call it on some event say button click, so add an onclick to your button:
<a class="btn btn-primary btn-lg" href="#" role="button" onclick="makePharse()">Learn more</a>
and comment out the
|
|
|
|
|
|
I added the social media buttons facebook, twitter and linkedin to my page. Works ok on Chrome, Firefox and Safari. It blocks (and sometimes crashes) IE11, I didn't check previous versions yet.
I have no idea why, does anyone have an idea on how to solve it? Right now, I check if it is IE and just disable the tweet and facebook buttons (linkedin is working).
isIE is a boolean that indicates if it is Internet Explorer and "removes" the functionality. (for now)
Here's the rendered code:
twitter
where the button should be
<div id="tweetlink"></div>
<script>
if(!isIE){
document.getElementById('tweetlink').innerHTML =
"<div><a href='https ://twitter.com/share' class='twitter-share-button' data-url='urlhere' data-size='large'>Tweet</a></div>";
}
</script>
<script>
if(!isIE){
$(window).load(function () {$.getScript('<a href="http://platform.twitter.com/widgets.js">http://platform.twitter.com/widgets.js</a>');});
}
</script>
facebook
part 1
in the head
<meta property="og:url" content="urlhere" />
<meta property="og:type" content="website" />
<meta property="og:description" content="Solar Timelines for AFFECTS" />
<meta property="og:image" content="http://urlhere/Styles/Images/GUI/STAFF_96x96.png" />
part 2
right after the body tag
<script>
if(!isIE){
window.fbAsyncInit = function() {FB.init({appId: 'idhere',xfbml: true,version: 'v2.5'});};
(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s);
js.id = id;
js.src = "//connect.facebook.net/en_GB/sdk.js#xfbml=1&version=v2.5";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));
}
</script>
part 3
somewhere in the html where button should be
<div class="fb-like" data-href="urlhere" data-layout="button_count" data-action="like" data-show-faces="false" data-width="200" data-share="true"></div>
I did google it, but all results popped up with how to block the buttons, not on how to "not block" the page.
Feel free to look at it here[^] @ bottom of the page. In Chrome all buttons are there in IE only linkedin is there.
|
|
|
|
|
Hi,
can any one tell me how to create a site column in javascript.
I used this in my code:
var fieldschema2='Field Type="Number" DisplayName="AccordionOrder" Name="AccordionOrder" Required="False" Indexed="True" EnforceUniqueValues="True"/>'
but control is going to failure method.
I also tried Numeric and Integer types but column is not created.Let me know.
modified 13-Nov-15 2:05am.
|
|
|
|
|
What in the world are you talking about? What type of grid control is this for? It looks like you are trying to create sever-side properties in JS and expect it to work. We need a lot more details to understand what you are talking about.
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
|
I have this JQuery here that I wrote a while ago. I use regex to extrack the price of the service. But now I added free services over a dollar amount, so I have instances in which service names now have 2 currency amounts.
So for example:
Free Shipping US48 $750.00 -- $0.00 USD
I just want the last match. Currently I get 2 matches,
$750.00
$0.00
Not sure if I should try and rewrite the Regex, or rewrite the JQuery.
I'm terrible with Regex, that's why I'm asking.
var rate_API_Text = $('input[name*="_lb_OP_AO_S2_Quotes_Original_Field"]:checked').next().text();
var rate_API_Index = rate_API_Text.indexOf("--");
var rate_API_Name = rate_API_Text.substr(0, rate_API_Index - 1);
$('[id*="_lbl_OP_AO_S2_Dashboard_StatusMessage_Field"]').text(rate_API_Name);
var rate_Amount = "$0.00";
var re_ratePlan = new RegExp("(\\$[0-9,]+(\\.[0-9]{2})?)");
var txt_ratePlan = $('input[name*="_lb_OP_AO_S2_Quotes_Original_Field"]:checked').next().text();
var match_ratePlan = re_ratePlan.exec(txt_ratePlan);
if (match_ratePlan.length !== null || match_ratePlan.length > 0) {
for (var i = 0; i < match_ratePlan.length; i++) {
rate_Amount = match_ratePlan[i] + "\n";
break;
}
if (match_ratePlan !== null) {
$('[id*="_lbl_OP_AO_S2_Dashboard_Calc_RateAmount_Field"]').text(rate_Amount);
}
else {
$('[id*="_lbl_OP_AO_S2_Dashboard_Calc_RateAmount_Field"]').text("$0.00");
$('[id*="_txt_Estimated_Rate_Field"]').val(rate_Amount);
}
}
|
|
|
|
|
I changed the source of the regex to the latter part of the string index instead.
That's what happens when you have to go back to code you wrote years ago. You forget exactly how it operates and you have to rethink it again.
var rate_API_Text = $('input[name*="_lb_OP_AO_S2_Quotes_Original_Field"]:checked').next().text();
var n = rate_API_Text.indexOf("--");
var rate_API_Name = rate_API_Text.substr(0, n - 1);
$('[id*="_lbl_OP_AO_S2_Dashboard_StatusMessage_Field"]').text(rate_API_Name);
var rate_Amount = rate_API_Text.substr(n, rate_API_Text.length - 1);
var re_ratePlan = new RegExp("(\\$[0-9,]+(\\.[0-9]{2})?)");
var match_ratePlan = re_ratePlan.exec(rate_Amount);
if (match_ratePlan.length !== null || match_ratePlan.length > 0) {
for (var i = 0; i < match_ratePlan.length; i++) {
rate_Amount = match_ratePlan[i] + "\n";
break;
}
if (match_ratePlan !== null) {
$('[id*="_lbl_OP_AO_S2_Dashboard_Calc_RateAmount_Field"]').text(rate_Amount);
}
else {
$('[id*="_lbl_OP_AO_S2_Dashboard_Calc_RateAmount_Field"]').text("$0.00");
$('[id*="_txt_Estimated_Rate_Field"]').val(rate_Amount);
}
}
|
|
|
|
|
Can anyone help am new in JavaScript environment I want to create a JavaScript tour guide library that will allow re-usability of the tour guide across various web applications.
|
|
|
|
|
Member 11984883 wrote: Can anyone help Not unless you explain exactly what help you want.
|
|
|
|
|
 ok thanks what I want to do is current I have a web application that is running and I have a bootstrap tour guide that is running, the problem with this one is each view has the own script for that tour guide that referencing the control ID on that view, now I want to develop one dynamic JavaScript tour guide library that I can use to the rest of my web application and even to the other .Net applications. hopping am clear now see what am current having now.
$(function () {
var startIndex = 0;
var tour = new Tour({
storage: window.localStorage
});
startIndex = tour._options.steps.length;
tour.addSteps([
{
element: "#first-name",
title: "Searching for an employee",
content: "To search for the employee to add, please type in the employee name or surname in the textbox provided.<br> Once you have found the employee, all his/her details will be pulled on your behalf.",
placement: "top",
},
{
element: "#surname",
title: "Searching for employee",
content: "Alternatively, you can search the employee by typing into the provided <strong>Surname</strong> textbox provided.",
placement: "top"
},
{
element: "#engagements",
title: "how to create engagements",
content: "To create engagements click on this engagements bottun .",
placement: "top"
},
{
element: "#administrator",
title: "how to do administration",
content: "To do administration click on the administration bottun.",
placement: "top"
},
{
element: "#dropdown",
title: "how to logout ",
content: "To logout on this system click on the drop down next to your name and click logout.",
placement: "top",
},
]);
tour.init();
tour.start();
});
|
|
|
|
|
Rather than re-inventing the wheel, have you considered using one of the many existing libraries that provide this type of functionality?
For example:
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|