|
Please sir, I would be very much grateful to you if you could guide me on how to create a web application with Javascript. I am a newbie but very eager to learn and I am working towards designing a data visualization tool. Currently learning Javascript and JSON. Have some idea of PHP.
Thank you sir.
Yours
Awal Sweds
|
|
|
|
|
These forums are for technical questions. Google will find you many tutorials on Javascript, PHP and other web design issues.
|
|
|
|
|
I'm testing in Chrome, Edge, FF, IE, and O.
The case is that a page has up to 5 iframes that show on a single page. A page is executed in each iframe. These pages have links to other pages that have links. A browser refresh returns the screen to the initial page state in all 5 browsers. But in Chrome and O, the history of the iframes of the set are not deleted. The browser back button or a JavaScript history(-1) button work as originally intended in FF, IE, and Edge. But in Chrome and O, these back buttons start to step back through the sequential history of all iframes. And the same thing happens with a single frame.
I do a querySelectorAll('iframe') on exit and refresh/load and no iframes are indicated. Yet, in Chrome and Opera, when the page refreshes and the iframes are created again, they remember the history of the same named iframes that were there before the refresh.
I refresh in 3 different ways in this application including the browser refresh button, parent,location,reload(parent.location.href), and parent,location,reload with a particular function. These all work in Edge, FF, and IE. I refresh and can back out of the page to the calling page. In chrome and Opera, even though the iframes have been removed, the new iframes retain the history of the previous iframes.
I have tried about half dozen approaches in JavaScript to insuring the iframes have been removed. My latest attempt follows. I'm not sure if I'm executing right, but the length is always 0.
var iframesx = document.querySelectorAll('iframe');
for (var i = 0; i < iframesx.length; i++) {
iframesx.parentNode.removeChild(iframesx);
}
This is a real navigation problem for this application in Chrome and Opera, and I would think for any application in a similar situation. The browser Back button and JavaScript History() methods are fundamental page navigation tools. Below is a link that demonstrates the problem. The page shows up to the 5 most recent years of a color map. All data is only for testing and some of the data was doubled up for testing. I believe this is a Chrome and Opera error. I've tried to find a way to clean up iframe history thouroghly, but with no success.
http:
Bring the page up in Chrome or Opera. Take some links in a couple of iframes. Refresh and hit the browser Back button as if you are backing out of the page. In Edge, FF, and IE, instead of going through the history of the iframes before the refresh, the back out works.
My platform is Windows 10 running Apache/2.0.64 (Win32), mod_perl/2.0.3, and Perl/v5.8.3. I am running the latest versions of all browsers being used in testing. However, I think this problem exists independent of platform.
Any help will be appreciated. Thanks.
|
|
|
|
|
It's not a good idea to base your solution on non-standard features. How browsers handle these things are up to the individual browsers, if you want your app to work on all browsers then only use things that are established standards.
|
|
|
|
|
Could you please give me a little guidance. I thought I was following common practices.
I tried random NAMEs and IDs on the iframes to no avail. How can the new iframes (new NAMEs and IDs) created after the refresh be associated with the history of the iframes that existed before the refresh. Maybe the html5 object would be a better choice.
modified 10-Aug-18 9:57am.
|
|
|
|
|
hi ,
jAVA SCRIPT HOW TO ADD IMAGES
|
|
|
|
|
var img = document.createElement('image');
img.src = '/blah.jpg';
document.body.appendChild(img);
"Never attribute to malice that which can be explained by stupidity."
- Hanlon's Razor
|
|
|
|
|
It appears your keyboard broke.
Everyone is born right handed. Only the strongest overcome it.
Fight for left-handed rights and hand equality.
|
|
|
|
|
you can try this code
<a href="www.google.com" id="x"><img id="y" src="images/test.png" /></a>
in JS :-
function changingImg(){
document.getElementById("y").src="./images/test2.png"
}
|
|
|
|
|
Hi Guys,
I need create javascript could identify sharepoint client userid (my guess is var _spPageContextInfo.userId) and open url passing this value.
my url is http://host/forms/frmservlet?config=test&otherparams=p_user=<sharepoint userid="">
Please help
Thanks Mary
|
|
|
|
|
hi
i need some help
how can i do to display the last soap request on a web page received and send the respose back to it
thanks
|
|
|
|
|
find 46 balls to convert overs progamming ?
|
|
|
|
|
This is not a good question - we cannot work out from that little what you are trying to do.
Remember that we can't see your screen, access your HDD, or read your mind - we only get exactly what you type to work with. 6 words and a number may mean something to you, but we don't have any idea what your homework is asking you to do, so they don't mean anything to us!
So stop typing the least you can, and explain what the problem is, show us the relevant code fragments, and tell us what you have done so far.
Sent from my Amstrad PC 1640
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
What!?
Everyone is born right handed. Only the strongest overcome it.
Fight for left-handed rights and hand equality.
|
|
|
|
|
Has anyone else noticed that NPM and Angular (in particular) generates a shocking number of dependency clashes? When I do an
npm ls -depth=0
I get about one hundred "ERR" lines, saying that I am missing peer dependencies. I am using Angular CLI on Angular 4, and apparently, npm has no "cleanup" function to resolve clashing and missing dependencies. Which begs the question; what the hell is it for, then?
One morning I shot an elephant in my pajamas. How he got in my pajamas, I don't know.
|
|
|
|
|
Throw Angular in the trash.
Everyone is born right handed. Only the strongest overcome it.
Fight for left-handed rights and hand equality.
|
|
|
|
|
I only get 3.
But maybe that explains why I'm having trouble with lazy loading.
I can lazy load say /home, but not /admin or /reviews
npm ERR! peer dep missing: @angular/common@6.1.0, required by @angular/router@6.1.0
npm ERR! peer dep missing: @angular/core@6.1.0, required by @angular/router@6.1.0
npm ERR! peer dep missing: @angular/platform-browser@6.1.0, required by @angular/router@6.1.0
Now I have 0 with Angular 6.1.1
Then 32 others that don't seem significant.
I adjusted my package.json and ran npm update
If it ain't broke don't fix it
Discover my world at jkirkerx.com
modified 17-Aug-18 18:58pm.
|
|
|
|
|
google.charts.load('current', { packages: ['corechart', 'line'] });
function drawBasic() {
var xValue = Number(document.getElementById("xValue").value);
var yValue = Number(document.getElementById("yValue").value);
var data = new google.visualization.DataTable();
data.addColumn('number', 'X');
data.addColumn('number', 'Packet');
data.addRows([[xValue, yValue] ]);
var options = {
hAxis: {
title: 'Time'
},
vAxis: {
title: 'Packet'
}
};
var chart = new google.visualization.LineChart(document.getElementById('chart_div'));
chart.draw(data, options);
}
<a>moved to </a>
<div id="chart_div"></div>
Y Value:
Demo
When ever user click the button with new values from the text box the data should get updated with continous graph
|
|
|
|
|
Just setup the chart again but change where the data comes from.
Everyone is born right handed. Only the strongest overcome it.
Fight for left-handed rights and hand equality.
|
|
|
|
|
I'm learning to script an application with ClearScript. My program is a tabbed text editor and the idea is to have access to all the open files via a List. For scripting, the program opens a separate window (so that the script is not part of the scriptable collection). Results are written to a second textbox. And there is where I discovered the problem. At present I'm just having the Javascript display the "FilePath" property of each item in the collection. This works fine with this script:
parent.OutPut.Text="";
var i;
var y=0;
for (i = 0; i < parent.OpenFiles.Count; i++) {
y += 1
parent.OutPut.Text += y + " " + parent.OpenFiles[i].FilePath + "\r\n";
}
parent.OutPut.Text += parent.OpenFiles.Count;
I get the following correct result in the textbox:
1 C:\Users\Alan\Documents\Transfer\From Toshiba\Projects\alanburkhart.com\WikipediaCrimeData_RawText.txt
2 C:\Users\Alan\Documents\Transfer\From Toshiba\Projects\alanburkhart.com\conspiracytheory.html
3 C:\Users\Alan\Documents\Transfer\From Toshiba\Projects\alanburkhart.com\USConsSearch.html
4 C:\Users\Alan\Documents\Transfer\From Toshiba\Projects\alanburkhart.com\wordley.html
5 C:\Users\Alan\Documents\new 1.txt
6 C:\Users\Alan\Documents\10Comms.txt
7 C:\Users\Alan\Documents\testfile.txt
8 C:\Users\Alan\Documents\Transfer\From Toshiba\TestSpellChecker.txt
9 C:\Users\Alan\Documents\Projects\NetPadd2 Help Files\AdntlRsc.html
10 C:\Users\Alan\Documents\Projects\NetPadd2 Help Files\intro.html
11 C:\Users\Alan\Documents\ForLoop.js
12 untitled_2.txt
13 C:\Users\Alan\Documents\ForEach.js
13
("13" is the number of items in the collection.)
However, if I use this script:
parent.OutPut.Text="";
var x;
var i=0
for (x in parent.OpenFiles) {
i+=1
parent.OutPut.Text += i + " " + parent.OpenFiles[x].FilePath + "\r\n";}
parent.OutPut.Text += parent.OpenFiles.Count;
I get the following result:
1 C:\Users\Alan\Documents\Transfer\From Toshiba\Projects\alanburkhart.com\WikipediaCrimeData_RawText.txt
2 C:\Users\Alan\Documents\Transfer\From Toshiba\Projects\alanburkhart.com\conspiracytheory.html
3 C:\Users\Alan\Documents\Transfer\From Toshiba\Projects\alanburkhart.com\USConsSearch.html
4 C:\Users\Alan\Documents\Transfer\From Toshiba\Projects\alanburkhart.com\wordley.html
5 C:\Users\Alan\Documents\new 1.txt
6 C:\Users\Alan\Documents\10Comms.txt
7 C:\Users\Alan\Documents\testfile.txt
8 C:\Users\Alan\Documents\Transfer\From Toshiba\TestSpellChecker.txt
9 C:\Users\Alan\Documents\Projects\NetPadd2 Help Files\AdntlRsc.html
10 C:\Users\Alan\Documents\Projects\NetPadd2 Help Files\intro.html
11 C:\Users\Alan\Documents\ForLoop.js
12 undefined
13 undefined
14 undefined
15 undefined
16 undefined
17 undefined
18 undefined
19 undefined
20 undefined
21 undefined
22 undefined
23 undefined
24 undefined
25 undefined
26 undefined
27 undefined
28 undefined
29 undefined
30 undefined
31 undefined
32 undefined
33 undefined
34 undefined
35 undefined
36 undefined
37 undefined
38 undefined
39 undefined
40 undefined
41 undefined
42 undefined
43 undefined
44 undefined
45 undefined
46 undefined
47 undefined
48 undefined
11
The number of "undefined" remains at 37 no matter how many open files I have. I'm not an expert with JavaScript although I usually can write a script that works. Can anyone give me an idea what is causing this? I'm stumped. I've been using this text editor a couple of years without issue (it's one I wrote for my own use) and I don't see a reason for the problem in my VB code. Is it the JS code? Any ideas are appreciated.
Sometimes the true reward for completing a task is not the money, but instead the satisfaction of a job well done. But it's usually the money.
|
|
|
|
|
I don't know anything about ClearScript, but in Javascript using
for(x in parent.OpenFiles) { iterates over all the members of whatever parent.OpenFiles happens to be. That will include parent.OpenFiles.Count and any other attributes it has (attributes can be accessed using parent.OpenFiles.Count or parent['OpenFiles']['Count'] ).
Your lines of undefined values are members of parent.OpenFiles that don't have their own member called FilePath , and there must be 37 of them.
Try using
parent.OutPut.Text += x + " " + parent.OpenFiles[x].FilePath + "\r\n";} to see the attribute names instead of the numeric value you are assigning them.
|
|
|
|
|
Graham Breach wrote: and any other attributes it has
I didn't realize that. Thank you. I was thinking in terms of the For Each loop in VB.
Sometimes the true reward for completing a task is not the money, but instead the satisfaction of a job well done. But it's usually the money.
|
|
|
|
|
How do I get all the input elements(by Id or name) from JSP/Html after form load, then attache the focusout/blur event to all input elements, so that I can get the value of the correspounding element when its got focusout.
|
|
|
|
|
finally I found it,here is the code.
$(window).bind("load", function() {
var form = this.document.forms['mainForm'];
var selectElement = form.querySelectorAll('input');
var i;
for (i = 0; i < selectElement.length; i++) {
$(document.getElementById(selectElement[i].id)).blur(function() {
console.log($(this)[0].name);
console.log($(this)[0].value);
});
}
});
modified 10-Jul-18 10:51am.
|
|
|
|
|
Application overview: Personal expenses management application that allows users to track how much money have they spent.
[MAJOR] Requirements:
As a result of test problem solution you should provide a command-line application that supports following commands:
● add 2017-04-25 12 USD Jogurt — adds expense entry to the list of user expenses.
Expenses for various dates could be added in any order.
Command accepts following parameters:
2017-04-25 — is the date when expense occurred
12 — is an amount of money spent
USD — the currency in which expense occurred
Jogurt — is the name of product purchased
● list — shows the list of all expenses sorted by date
● clear 2017-04-25 — removes all expenses for specified date, where:
2017-04-25 — is the date for which all expenses should be removed
● total PLN — this command should take a list of exchange rates from http:
PLN — is the currency in which total amount of expenses should be presented
[MINOR] Requirements: In order to get extra points for test problem solution you might cover your source code with unit tests.
Application usage example: Here is an example of normal application usage flow, for each command a corresponding output is shown:
add 2017-04-25 2 USD Jogurt
2017-04-25
Jogurt 2 USD
add 2017-04-25 3 EUR "French fries"
2017-04-25
Jogurt 2 USD
French Fries 3 EUR
add 2017-04-27 4.75 EUR Beer
2017-04-25
Jogurt 2 USD
French Fries 3 EUR
2017-04-27
Beer 4.75 EUR
add 2017-04-26 2.5 PLN Sweets
2017-04-25
Jogurt 2 USD
French Fries 3 EUR
2017-04-26
Sweets 2.5 PLN
2017-04-27
Beer 4.75 EUR
list
2017-04-25
Jogurt 2 USD
French Fries 3 EUR
2017-04-26
Sweets 2.5 PLN
2017-04-27
Beer 4.75 EUR
clear 2017-04-27
2017-04-25
Jogurt 2 USD
French Fries 3 EUR
2017-04-26
Sweets 2.5 PLN
total EUR
5.42 EUR
I’ve tried to do it like this, but i don’t know what to do next.
<pre lang="Javascript"><pre><pre lang="Javascript"><pre lang="Javascript"><pre lang="Javascript"><pre lang="Javascript"><pre lang="Javascript"><pre lang="Javascript"><pre lang="Javascript"><pre lang="Javascript"> class List { constructor(date, amount, currency, product)
{
this._date = date;
this._amount = amount;
this._currency = currency;
this._product = product;
}
get data (){
return this._data;
}
get amount(){
return this._amount;
}
get currency (){
return this._currency;
}
get product (){
return this._product
}
}
class Result extends List {
constructor(date, amount, currency, product) {
super(date);
this._amount = amount;
this._currency = currency;
this._product = product;
} }
const out = new Result(2017-04-25, 12, 'USD', 'Jogurt');
console.log(Result);
|
|
|
|