|
 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
|
|
|
|
|
<java>
I am trying to store user input (string values) into a 2d array but am unable to figure out how to do a for loop for String values.
User will input a First Name, Last Name, Phone, and Age
public class Lab2
{
public static void main(String[] args) {
//Example Data but need it entered by a user
String [][] array = {
{"Ryan", "Smith", "555555555", "12"},
{"George", "Young", "123456789", "52"},
{"Frank", "McDonnell", "555123789", "18"}
};
//Create a for loop for user input
//Displays the entire array
for (int row=0; row<array.length; row++){
="" for="" (int="" col="0;" <array[row].length;="" col++){
="" system.out.print(array[row][col]+"="" ");
="" }
="" system.out.println();
}
}
}
<="" java="">
|
|
|
|
|
Does this have anything to do with Javascript?
|
|
|
|
|
I want to make a web page contains headline news from differnt web sites.
I want to refresh it daily.
I prefere to do this by a javascript code.
Can any one help me?
|
|
|
|
|
You could possibly fetch the RSS feeds from different news websites, like BBC etc. They all provide you with functionality to fetch the latest feeds from their servers and you can then render those RSS feeds on your website.
The website would then act as an RSS feed reader. Before you begin, I would recommend that you read about RSS[^], RSS feeds (same as RSS) and RSS Readers (the application which pulls the RSS feeds and then display them in the device). Understand them and them implement the service in your application.
Also, why would you like to pull it using JavaScript when you can pull it using your server-side language too? Which would be much more fast and efficient.
The sh*t I complain about
It's like there ain't a cloud in the sky and it's raining out - Eminem
~! Firewall !~
|
|
|
|
|
thanks for replaying.
I need to feed my web page from sites don't all proceed rss feeds (such as http://ara.reuters.com)
This is a personal web page for me only to read news more easily.
|
|
|
|
|
I want to load a png image in base64 to html5 canvas element. I have this code:
<html>
<head></head>
<body>
<canvas id="pageCanvas"></canvas>
<script type="text/javascript">
var canvas = document.getElementById("pageCanvas");
var ctx = canvas.getContext("2d");
var imageData ="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAIAAAACDbGyAAAAAXNSR0IArs4c6QAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9oMCRUiMrIBQVkAAAAZdEVYdENvbW1lbnQAQ3JlYXRlZCB3aXRoIEdJTVBXgQ4XAAAADElEQVQI12NgoC4AAABQAAEiE+h1AAAAAElFTkSuQmCC";
var imageObj = new Image();
imageObj.src = imageData;
ctx.drawImage(imageObj, 50, 100);
</script>
</body>
</html>
The above code working well in IE, chrome, Microsoft edge. But in Firefox the image was not displayed. It display blank page. Sometime when we reload the page then it displayed an image in canvas.
Best,
Parthi
|
|
|
|
|
There is no such code that works "sometimes". Code either works or doesn't work, but it can depend on the underlying libraries and stuff like that so the first time it doesn't work because the framework isn't ready and then works because everything is set up.
But it is still not convincing to believe that a reload fixes everything. Take this, press F12 and try to look for the error that this image gives. Console would log the error and you can see that error to find a solution, or post it here so we may help you.
The sh*t I complain about
It's like there ain't a cloud in the sky and it's raining out - Eminem
~! Firewall !~
|
|
|
|
|
yes, i checked the console window but it does show any error.
|
|
|
|
|
I'm doing an assignment with an order form and was wondering if there is a function that will auto fill the cost field after entering the quantity field?
|
|
|
|
|
You really miss the point of having an assignment: you are supposed to figure it out, and in the process, learn!
You may wish to get used to that idea sooner, rather than later, as that's what this business is all about.
Here's something for you to consider that's an important part of figuring out how to answer your question: where is the cost-per-unit data located at the time the quantity is entered? A lot depends upon that.
"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 |
|
|
|
|
|
@WW∴ Balboos - forums are for getting help a-hole. if you don't have an answer mind your own business.
|
|
|
|
|
Looks like the OP has been deactivated by the hamsters for his abusive reply.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Yeah - I noticed that when I tried to see what else he's been up to (i.e., aside from trying to get his homework done). I think what was most annoying is that I even gave him some suggestions rather than the tried-and-true "Do Your Own Homework".
Maybe someone can develop a CP-AI that would recognize the new accounts created by those who are thrown out of the hamster cage.
"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 |
|
|
|
|
|
W∴ Balboos wrote: I tried to see what else he's been up to
Lots of homework[^] it seems.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Member 11972043 wrote: if there is a function that will auto fill the cost field after entering the quantity field? No. You have to write it yourself.
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
|
I still can believe the web runs on it! If there is any proof the devil exists javascript must be it.
It is so easy to make a mistake and not catch it until you are debugging.
|
|
|
|
|
I can understand your frustration. Maybe you want to take a look on TypeScript.
|
|
|
|
|
I've done some typescript and I absolutely love what Anders Hedjelsberg did.
The library I will be using still needs a typescript facade though , so I have to stick with javascript.
I can't help but wonder what were the twisted minds that created this devil-spawn language thinking when they were going through the design process.
modified 28-Oct-15 18:00pm.
|
|
|
|
|
I do believe they were thinking about making a language the ENTIRE web could run on. Not simply making the process easy or simple for you.
|
|
|
|
|
Auto-completion can't do it all.
In a compiled language, the compiler might catch an error - but not a bug.
In a scripted language, you need to run it.
If either of these routes is unsuitable, I would suggest finding an alternate language for your problems.
"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 |
|
|
|
|
|
Auto completion can't do it all.
Well , of course not , but it's a great tool when you are learning a new library. Even after you have learned it's a big help.
In a compiled language, the compiler might catch an error - but not a bug.
In a compiled language the compiler will catch all syntax errors.
And it will spot some bugs ( dead code, unused variables , uninitialized variables).
If either of these routes is unsuitable, I would suggest finding an alternate language for your problems.
Of course they don't suite my needs, I'll be using typescript whenever I can unluckily for some cases there is no other choice than using javascript.
|
|
|
|
|
Armando de la Torre wrote: It is so easy to make a mistake and not catch it until you are debugging. That's true for any language. But JavaScript does keep you on your toes. If you miss a closing bracket somewhere you may not notice it for quite a while. JS can be a pain.
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
|
I want to use buttons in tree. So I used the article Working on JSON objects in jQuery and MVC given by Dr. Song Li in 24 Nov 2010. I have taken button instead of textnode. The buttons work fine first time. But these buttons do not fire after addExamBySession or addExamByjson is clicked.
var dateDeserialize = function (dateStr) {
var dt = new Date(parseInt(dateStr.substr(6)));
return prependZero((dt.getMonth() + 1))
+ "/" + prependZero(dt.getDate())
+ "/" + dt.getFullYear()
+ " " + prependZero(dt.getHours())
+ ":" + prependZero(dt.getMinutes())
+ ":" + prependZero(dt.getSeconds());
};
var FixDateinJson = function (JsonStudents) {
$.each(JsonStudents, function (i, JsonStudent) {
$.each(JsonStudent.ClassesTaken, function (i, JsonClass) {
$.each(JsonClass.ExamesTaken, function (i, JsonExam) {
JsonExam.ExamTime = dateDeserialize(JsonExam.ExamTime);
});
});
});
return JsonStudents;
}
var buildStudentTree = function (students) {
var createTextNode = function (text,id) {
var span = document.createElement("span");
span.setAttribute("style", "margin-left: 2px");
($('<input>').attr('type', 'button').attr('id',id)
.attr('value', text)).appendTo(span);
return span;
};
var root = document.createElement("ul");
root.id = "StudentTreeRoot";
root.setAttribute("style", "margin: 15px");
root.className = "filetree";
$.each(students, function (i, student) {
var studentNode = document.createElement("li");
studentNode.className = "closed";
var span = document.createElement("span");
span.className = "folder";
span.appendChild(createTextNode(student.Name, 's'+(i+1)));
studentNode.appendChild(span);
var classesNode = document.createElement("ul");
$.each(student.ClassesTaken, function (j, aClass) {
var classNode = document.createElement("li");
classNode.className = "closed";
span = document.createElement("span");
span.className = "folder";
span.appendChild(createTextNode(aClass.Name, 'c' + (i+1)));
classNode.appendChild(span);
var examesNode = document.createElement("ul");
examesNode.className = "folder";
$.each(aClass.ExamesTaken, function (k, aExam) {
var examNode = document.createElement("li");
examNode.className = "closed";
span = document.createElement("span");
span.className = "folder";
span.appendChild(createTextNode(aExam.Description, 'e' + (i + 1)));
examNode.appendChild(span);
var detailNode = document.createElement("ul");
var examTime = document.createElement("li");
span = document.createElement("span");
span.className = "file";
span.appendChild(createTextNode(aExam.ExamTime,'et'+(i+1)));
examTime.appendChild(span);
detailNode.appendChild(examTime);
var score = document.createElement("li");
span = document.createElement("span");
span.className = "file";
span.appendChild(createTextNode(aExam.Score, 'es'+(i+1)));
score.appendChild(span);
detailNode.appendChild(score);
examNode.appendChild(detailNode);
examesNode.appendChild(examNode);
});
classNode.appendChild(examesNode)
classesNode.appendChild(classNode);
});
studentNode.appendChild(classesNode);
root.appendChild(studentNode);
});
$("#StudentTree").html("").append(root);
$("#StudentTreeRoot").treeview();
};
$(document).ready(function () {
$("#StudentTree").html("");
$.ajax({
cache: false,
type: "POST",
async: false,
url: GetStudentsURL
+ "/?NoOfStudents=" + NoOfStudents
+ "&NoOfClasses=" + NoOfClasses
+ "&NoOfExams=" + NoOfExams,
dataType: "json",
success: function (students) {
StudentJson = FixDateinJson(students);
buildStudentTree(StudentJson);
}
});
$("#btnAddAnExamJson").click(function () {
$("#StudentTree").html("Loading ...");
$.ajax({
cache: false,
type: "POST",
url: AddAnExamByJsonURL,
contentType: 'application/json',
dataType: "json",
data: JSON.stringify(StudentJson),
success: function (students) {
StudentJson = FixDateinJson(students);
buildStudentTree(StudentJson);
}
});
});
$("#btnAddAnExamSession").click(function () {
$("#StudentTree").html("Loading ...");
$.ajax({
cache: false,
type: "POST",
url: AddAnExamBySessionURL,
dataType: "json",
success: function (students) {
StudentJson = FixDateinJson(students);
buildStudentTree(StudentJson);
}
});
});
$("#s1, #s2, #s3, #c1, #c2, #c3, #e1, #e2, #e3").click(function () {
alert($(this).attr('id') + ' Clicked');
$.ajax({
cache: false,
type: "POST",
dataType: "json",
success: function (students) {
StudentJson = FixDateinJson(students);
buildStudentTree(StudentJson);
}
});
});
});
</script>
</head>
<body>
<div id="TitleContainer"><%= ViewData["ApplicationTitle"]%></div>
<div id="MainContainer">
<div id="StudentTree"></div>
<div id="ButtonContainer">
<button id="btnAddAnExamSession" class="ButtonStyle">
Add an exam to students using session</button>
<button id="btnAddAnExamJson" class="ButtonStyle">
Add an exam to students by posting Json</button>
</div>
</div>
</body>
</html>
modified 22-Oct-15 1:18am.
|
|
|
|
|