 |
 | I'd like to find a tutorial or code to learn how to do this: on a web page user enters text to search, then checks checkbox to indicate which fields to search.
* Testing should work in Firefox without installing anything else on my PC. Someone told me AJAX has some problems which disappear if run on a server, and I don't have access to a server with AJAX. * I don't know if jquery would help me here or not. I know nothing about it. * Find tutorials about filtering with XML, but not where they get user input from a form.
Screenshot of idea is here[^]
XML file is here:
<?xml version="1.0"?> <?xml-stylesheet type="text/xsl" href="studies1.xsl"?> <studies> <!-- There is only one study inthis example but in real life there could be 500+. --> <study> <authors> <author> <authorfname>Bill</authorfname> I enclosed all the XML in pre and /pre tags and it still doesn't show. What am I doing wrong here?
modified 5 days ago.
|
|
|
|
 | What architecture are you planning to use? MVC ?
|
|
|
|
 | Dear all,
I want show a picture fullscreen with one web page, but most of the web browers have address bars, toolbars and tab bars, I want show the picture without them all. For example, I use Chorme browser. How to implement it with JavaScript or other methods ?
Thanks all
|
|
|
|
 | In browsers that support it[^], you can use the fullscreen API:
And anticipating your next question, no, there is no way to launch fullscreen mode without asking for the user's permission. 
"These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer
|
|
|
|
 | Hi Richard,
It's very kind of you, thanks a lot, I'll do some tests and feedback later.
Thanks
|
|
|
|
 | Hi Richard, Thank you once again, I have tried the API,it works and very useful for me. But not reach my goal, as you say there's no way to lanuch fullscreen mode without asking for the user's permission. I have tried to set the state of the key clicked when load the page, so that it can trigger fullscreen mode when open the page, but it does not work in this way. My goal is to show a photo on the screen like desk background pictures, and some other info like Date, temperature and so on. For the device, may be I can ues Raspberry pi or my old computer. For my goal, it's not only like a project of digital photo frame, but also a smart home controller. First of first, show the photo with fullscreen, maybe I should try another solution, can please give me some suggests?
Thanks B/R Jiang
|
|
|
|
 | As I said, you cannot enter fullscreen mode without the user's permission.
If there was a way around that restriction, I'm sure every scam, malware and porn site would be doing it.
"These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer
|
|
|
|
 | I need simple Javascript code to "Revert To Saved" a fillable PDF form. Thanks!
|
|
|
|
|
 | - Using Firefox v43.
- Trying example at Simple and Practical Introduction to Asynchronous JavaScript and XML (AJAX)[^]
- I'm a newbie here and with Javascript. If this isn't the right site for newbies just let me know. Some sites are somewhat hostile to newbies.
- I do have Ublock Origin in FF, I don't know if that or FF is blocking popups or not. If so, how do I get FF to not block popups from local HTM files?
I made the XML file and html file (which I called ajax1.htm) and opened it in Firefox. I clicked the button "ReadXML" and it did nothing, nothing changed in my browser.
I'm trying to figure out if FF does not support XMLHttpRequest or if something else is going on. Do you have any ideas?
EDIT: The bottom of ajax1.htm has been changed to this to test the Error() function via clicking a new button. I got no result from clicking the "Test error" button either. (The code formatting does not seem to be working.) </script> <script type="text/javascript"> function testButton() { Error("This is an error"); } </script> <body> <span id="xmlSpan"></span> <input type="button" onclick="ReadXmlFile();"value="ReadXml" /> <input type="button" onclick="testButton();"value="Test Error" />
modified 25-May-16 15:14pm.
|
|
|
|
 | 1. The link you posted is to an article. Usually if you have a question about the article you post it at the bottom of the article. In this case I think it's still valid that you asked here. 2. Notice the date on that article, 2009. Quite old in tech years. I suggest using jQuery and calling .ajax() instead. There are tons of examples online and jQuery is a library that keeps up with the various browsers so the same code should work in all browsers. 3. See jQuery.ajax() | jQuery API Documentation[^] for documentation. 4. Also, if you choose to stick with your original question, edit it and post the relevant code.
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
 | When you have a question about code in an article, it's usually best to post it in the forum at the bottom of the article[^]. That way, the author will be notified of your question and have a chance to respond. The person who wrote the code is the person most likely to be able to answer your question. 
Are you loading the page from a web site, or just double-clicking on the HTML file in Windows Explorer? You might have problems making AJAX requests work in a local file.
Have you tried checking the Web Console[^] (F12) for error messages?
Firefox definitely supports the XMLHttpRequest : XMLHttpRequest[^] Can I use... XMLHttpRequest advanced features[^]
Error isn't a built-in function, and doesn't appear to be defined in the article's code. Try using alert instead:
function testButton() { alert("This is an error"); }
"These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer
|
|
|
|
 | I'm opening a local HTML file. And I didn't know Error() wasn't a standard function. So I'll look into that. Thanks.
If I put the html file on a web server (I have an account on sdf.org) will Ajax work then? That sounds like a PITA if Ajax won't work in a local file.
|
|
|
|
 | I'm not certain that it won't work from a local file; I've just seen a few issues crop up with local files that are resolved by using a web server.
You don't need a live server to deploy it. You can use a local instance of IIS, or create a project in Visual Studio and use IIS Express.
If you haven't got a copy of Visual Studio, you can get Community Edition for free: Free Dev Tools - Visual Studio Community 2015[^]
"These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer
|
|
|
|
|
 | Hi,
I am beginner for AngularJS and learning, I am trying to execute the following AngularJS script, it is not firing. Can you please help me where did I do mistake?
Here is my script <!DOCTYPEhtml><htmlxmlns="http://www.w3.org/1999/xhtml"data-ng-app=""><head><title>Using AngularJS Directives and Data Binding</title></head><bodydata-ng-init="names=['Abdul Aleem', 'Farha Tabassum', 'Abdul Muqtadir', 'Abdul Malik']"> Name : <inputtype="text"data-ng-model="name"/>{{name}} <ul><lidata-ng-repeat="personName in Names"> {{personName}} </li></ul> <pre><divclass="container"data-ng-controller="SimpleController"><h3>Adding a Simple Controller</h3><ul><lidata-ng-repeart="cust in customers"> {{cust.Name}} - {{cust.City}} </li></ul></div><script>function SimpleController($scope) { $scope.customers = [ { Name: { Name: {Name: { Name: { Name: ]; } <script> <script src="Scripts/WebForms/angular.min.js" > </script> </body> </html> Thanks,
Abdul Aleem
"There is already enough hatred in the world lets spread love, compassion and affection."
|
|
|
|
 | try this, the underline one are your mistakes
<!DOCTYPEhtml><htmlxmlns="http://www.w3.org/1999/xhtml"data-ng-app="myapp"><head><title>Using AngularJS Directives and Data Binding</title></head><bodydata-ng-init="names=['Abdul Aleem', 'Farha Tabassum', 'Abdul Muqtadir', 'Abdul Malik']"> Name : <inputtype="text"data-ng-model="name"/>{{name}} <ul><lidata-ng-repeat="personName in names"> {{personName}} </li></ul> <divclass="container"data-ng-controller="SimpleController"><h3>Adding a Simple Controller</h3><ul><lidata-ng-repeat="cust in customers"> {{cust.Name}} - {{cust.City}} </li></ul></div> <scriptsrc="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.5/angular.min.js"></script> <script> var app = angular.module( app.controller(function SimpleController($scope) { $scope.customers = [ { Name: { Name: { Name: { Name: { Name: ]; } </script> </body></html>
demo: JSFiddle[^]
|
|
|
|
 | Message Removed
modified 22-May-16 6:37am.
|
|
|
|
 | add this line
<scriptsrc="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.5/angular.min.js"></script> angular js is missing..
|
|
|
|
 | Yeah thanks Karthik I did it that's why removed it but before removing you posted the answer it seems thank you very much for your help. Thanks,
Abdul Aleem
"There is already enough hatred in the world lets spread love, compassion and affection."
|
|
|
|
|
 | Sure I will use it, thanks for bringing this into my notice, I have been using this site for a long time, maybe young people like you learn faster .God bless you Karthik. Thanks,
Abdul Aleem
"There is already enough hatred in the world lets spread love, compassion and affection."
|
|
|
|
 | Hi,
I changed it in the below way but still the {{cust.Name}} - {{cust.City}} are giving me null values, web page is not showing any values against them.
Can you please help me why is it not showing me any values for cust.Name and cust.City? <!DOCTYPEhtml><htmlxmlns="http://www.w3.org/1999/xhtml"data-ng-app="myapp"><head><title>Using AngularJS Directives and Data Binding</title><scriptsrc="http://ajax.googleapis.com/ajax/libs/angularjs/1.2.23/angular.min.js"></script> </head><bodydata-ng-init="names=['Abdul Aleem', 'Farha Tabassum', 'Abdul Muqtadir', 'Abdul Malik']"> Name : <inputtype="text"data-ng-model="name"/>{{name}} <ul><lidata-ng-repeat="personName in Names"> {{personName}} </li></ul> <pre><divclass="container"data-ng-controller="SimpleController"><h3>Adding a Simple Controller</h3><ul><lidata-ng-repeart="cust in customers"> {{cust.Name}} - {{cust.City}} </li></ul></div><script> var app = angular.module( app.controller(function SimpleController($scope) { $scope.customers = [ { Name: { Name: { Name: { Name: { Name: ]; }); </script> </body> </html> Thanks,
Abdul Aleem
"There is already enough hatred in the world lets spread love, compassion and affection."
|
|
|
|
 | try this, your task to find the difference
<!DOCTYPEhtml><htmlxmlns="http://www.w3.org/1999/xhtml"data-ng-app="myapp"><head><title>Using AngularJS Directives and Data Binding</title><scriptsrc="http://ajax.googleapis.com/ajax/libs/angularjs/1.2.23/angular.min.js"></script> </head><bodydata-ng-init="names=['Abdul Aleem', 'Farha Tabassum', 'Abdul Muqtadir', 'Abdul Malik']"> Name : <inputtype="text"data-ng-model="name"/>{{name}} <ul><lidata-ng-repeat="personName in names"> {{personName}} </li></ul> <divclass="container"data-ng-controller="SimpleController"><h3>Adding a Simple Controller</h3><ul><lidata-ng-repeat="cust in customers"> {{cust.Name}} - {{cust.City}} </li></ul></div><script> var app = angular.module( app.controller( $scope.customers = [ { Name: { Name: { Name: { Name: { Name: ]; }); </script> </body></html>
|
|
|
|
 | Yes I found them, they are spelling mistakes Thank you Karthik Thanks,
Abdul Aleem
"There is already enough hatred in the world lets spread love, compassion and affection."
|
|
|
|
|
 | Message Removed
modified 8-May-16 13:23pm.
|
|
|
|
 | I have this function that writes HTML5 in a MVC View, then it populates the 5 select elements. But I want to make sure the elements are populated first before I set the data record in it. I have a problem with the last select element not having it's value selected, so I suspect the options haven't completed yet.
So I tried this, but it won't magically work without me modifying each function with a promise or something. The first promise was easy to figure out, but adding a promise to my $Ajax function seems more complicated. I have no clue how to add the promise to the 3nd code sample.
load_cardData_update_record(_paymentID) // Final Ajax call is the final $Ajax call that grabs the record. Maybe I'm going about this wrong. Perhaps I should grab the record first before writing all this HTML to the DOM. $uContainer.empty().html(uElements).show().promise().done(function (arg1) { select_cardBrands('CreditDebitRecord_Update_Card_Brand'); select_expMonths('CreditDebitRecord_Update_Card_ExpMonth'); select_expYears('CreditDebitRecord_Update_Card_ExpYear'); load_updateCard_countryCodes(); load_updateCard_stateCodes("US"); $.when( select_cardBrands(), select_expMonths(), select_expYears(), load_updateCard_countryCodes(), load_updateCard_stateCodes() ).then(load_cardData_update_record(_paymentID)); $("#CreditDebitRecord_Update_BillingAddress_CountryCode").change(function () { var _countryCode = $("#CreditDebitRecord_Update_BillingAddress_CountryCode option:selected").val(); load_updateCard_stateCodes(_countryCode); }); $("#CreditDebitRecord_Update_Card_Name").focus(); }); And a sample function that uses $Ajax and needs a promise. function select_cardBrands(_parent) { var $select = $('#' + _parent), option = ''; $.ajax({ type: "POST", cache: false, dataType: "json", url: '/Ajax/json_select_load_cardBrands', data: { }, error: function (response) { debugger; alert("http code: " + response.status + " Error: json_select_load_cardBrands - data: " + response); $e_UpdateCreditDebit.toggleClass('active'); }, success: function (data) { for (var x = 0; x < data.length; x++) { option += '<option value="' + data[x].value + '">' + data[x].text + '</option>'; } $select.html(option); } }); }
|
|
|
|
 | OK, that was difficult to understand. But is needed so teh form doesn't fail on the user. Any comments, would you do it different? $uContainer.empty().html(uElements).show().promise().done(function (arg1) { var promise_cardBrands = select_cardBrands('CreditDebitRecord_Update_Card_Brand'); promise_cardBrands.done(function () { select_expMonths('CreditDebitRecord_Update_Card_ExpMonth'); select_expYears('CreditDebitRecord_Update_Card_ExpYear'); var promise_Countries = load_updateCard_countryCodes(); promise_Countries.done(function () { var promise_States = load_updateCard_stateCodes("US"); promise_States.done(function () { var promise_Record = load_cardData_update_record(_paymentID); }); }); }); $("#CreditDebitRecord_Update_BillingAddress_CountryCode").change(function () { var _countryCode = $("#CreditDebitRecord_Update_BillingAddress_CountryCode option:selected").val(); load_updateCard_stateCodes(_countryCode); }); $("#CreditDebitRecord_Update_Card_Name").focus(); }); function load_updateCard_stateCodes(_countryCode) { var $e_StateCode = $("#CreditDebitRecord_Update_BillingAddress_StateCode"), procemessage = "<option value='0'> Please wait...</option>", deferred = new $.Deferred(); if (_countryCode !== '--') { $e_StateCode.html(procemessage).show(); $.ajax({ type: "POST", cache: true, dataType: "json", url: '/Ajax/load_StateCodes', data: { CountryCode: _countryCode }, error: function (response) { debugger; alert("http " + response.status + " Error: load_stateCodes - data: " + response); }, success: function (data) { var markup = "<option value='--'>Select State / Province</option>"; for (var x = 0; x < data.length; x++) { markup += "<option value=" + data[x].value + ">" + data[x].text + "</option>"; } $e_StateCode.html(markup).show(); deferred.resolve("finished"); } }); } return deferred.promise(); }
|
|
|
|
 | I don't think that I would chain the promises quite like that, since it'll be hard to do anything with it down the road and it forces asynchronous operations into a synchronous format.
I'd personally use a tracking object as a pre-load sentinel for your primary business object, pass an update/check callback to the resolution of each async call, and send them all off at once. This also gives the capability of seeing which particular calls might fail, rather than have the whole bundle collapse in on itself if there's an issue.
An example might look like: var loadTracker = { track1: false; track2: false; track3: false; track4: false; } function doSomething(promiseItemName) { loadTracker[promiseItemName] = true; if(loadTracker.track1 && loadTracker.track2 && loadTracker.track3 && loadTracker.track4){ doThePromiseDependentThing(); } } track1Promise.done(function(){ doSomething('track1'); }); "There are three kinds of lies: lies, damned lies and statistics." - Benjamin Disraeli
|
|
|
|
 | I'll take your advice on that!. But will wait for 1 more vote on that. And my idea didn't work on my iphone 6s+
|
|
|
|
 | All good. That's a pretty quick and dirty construct which can be greatly (and easily) improved. "There are three kinds of lies: lies, damned lies and statistics." - Benjamin Disraeli
|
|
|
|
 | Alright, I fixed my iPhone issue so I will make an attempt now to implement your concept. Thanks!, I'll up vote it when I'm done.
|
|
|
|
 | I am looking for an API that is similar to YouTube Help popup window.
The popup window can be seen on clicking the Help link on the footer of YouTube homepage. The screenshot of it is attached here
Basically I need the API for documentation that looks and works similar to this, having a search box on the top and a Markdown for writing/managing the content
Thanks
|
|
|
|
 | is there any way to know that web page has thrown any error.
i.e. i am using some api and it throws some error in background i.e. on console.
so i want to do like this. if on page myPage.html is there any error thrown by server or js or api or any other thing i want to show alert box.
i tried to add on error event on body of html element but it does not work.
|
|
|
|
 | rorschach217 wrote: but it does not work. Please do not expect people to understand what that is supposed to mean. If you have a problem then edit your question and add some proper details.
|
|
|
|
 | From your title , my understanding is that you want to handler browser error in javascript but when I read your description , you are contradicting yourself.
You need to understand that Javascript can only handle client scripting errors not server errors unless you pass something in a client script to talk to your javascript code.
There are lot of techniques you can find if you google it.
|
|
|
|
 | Hi Everyone.
I am trying to save multiple rows from angular UI grid to a database using for loop. I am calling controller action method using http.post. Could anyone help me out in guiding how to save multiple rows using http request.
Thanks Syed
|
|
|
|
 | Just put your call into a loop. Sounds like you already have a loop so where is the problem?
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
 | Server call in a loop could lead to performance issue. Add them in to JSON Array in a loop and pass it to server call at the end.
|
|
|
|
 | help me writing a small program
|
|
|
|
 | Do not repost. The sh*t I complain about It's like there ain't a cloud in the sky and it's raining out - Eminem ~! Firewall !~
|
|
|
|
 | main(){} small enough? Software rusts. Simon Stephenson, ca 1994. So does this signature. me, 2012
|
|
|
|
|
 | hi i wrote a code for the 2nd part in the following. but i dont know where am i going wrong. need help.
Create a new Java Project in Eclipse named HW6_lastName and complete the following requirements based on the Threads. Several threads will share a single object and contribute their individual result to the shared object. The shared object accumulates the partial results. Create a package named cs520.hw6. Using this package, create the following classes. Create a class named SharedResults as follows. The class keeps track of the shared result. The instance (or member) private variable – result (int). A void addToResultmethod which takes the given integer argument and adds it to the shared result. This method then prints to the console the name of the current thread, the value it added, and the cumulative result. Handle the synchronization issue with this method. The getResult method with no arguments which returns the shared result. Handle the synchronization issue with this method. 2. Create a class named LongTask which extends the Thread class. a.The instance (or member) private variables – sharedData (of type SharedResults), start (integer) and end (integer). b.A single constructor which takes the above three arguments and stores them in the instance values. Also, create a name forthis thread as Thread_<start>_<end> c.In the run method, add the integer numbers from start to end (both inclusive) using a for loop. Also, sleep for a random time (up to 10 milliseconds) in each iteration of the loop. After the loop, invoke the addToResult method of the shared object and provide this accumulated sum. Create a Test class to test the following functionality in its main method. a.Create the SharedResults object and assign it to a variable. b.Create five LongTask objects by passing the above shared object and the start and end values for each as (1, 100), (101, 200), (201, 300), (301, 400), and (401, 500) respectively. c.Start each thread as it is created. d.Wait for all the threads to complete using the join method. e.Print the result from the shared object. Sample Output: Create an archive of your Eclipse project using the following steps. Select the HW6_lastName project in the Eclipse IDE’s Package Explorer or the Navigator window. Click File->Export. Select the General->Archive File option. Click Next. Specify the “To archive file:” entry as say, C:TempHW6_lastName.zip. The zip file will be created and stored in the C:Temp folder. Submit this zip file as an attachment in the Assignment Section of Vista.
|
|
|
|
 | small... xD 
|
|
|
|
 | We do not do the homeworks, because you have to do that yourself.
However, if you also include the problem that you are encountering then we can guide you, if that is a technical problem. Mostly, the problems are basic such as NullPointerException etc. and others. So, try to add the error messages and what you were expecting, so that we can guide. The sh*t I complain about It's like there ain't a cloud in the sky and it's raining out - Eminem ~! Firewall !~
|
|
|
|
 |  package cs520.hw6.part1;
public class LongTask extends Thread { // instances of sharedData start and end @SuppressWarnings("unused") private static SharedResults sharedData = new SharedResults(); public int start; public int end;
// Constructor with three arguments public LongTask(SharedResults sd, int start1, int end1) { Thread t = Thread.currentThread(); t.setName("Thread_"+start1+"_"+end1); // creating name for thread start = start1; end = end1; System.out.print(t.getName() + "is Adding:- "); //run(start, end); }
public void run(){ try{ int sum = 0; // adding integers from start to end for(int i = start; i <= end; i++) { try { Thread.sleep(10);// sleep for 10 milliseconds } catch (InterruptedException e) { e.printStackTrace(); } sum += i; }
System.out.println(sum); SharedResults.addToResults(sum); // invoking addtoresults method }catch(NullPointerException e) { e.printStackTrace(); }
} }
package cs520.hw6.part1;
import java.util.ArrayList;
public class SharedResults {
// arraylist results instance private static ArrayList results = new ArrayList<>();
// default constructor public SharedResults() {
}
// void method that takes in integer and adds it to results public static void addToResults( int values){ //printing values results.add(values); results.size(); System.out.println("Cumulative Results are: " + results); }
// get result method public static int getResult(){ int sum = 0; for(int i = 0; i < results.size(); i++) { sum += results.get(i); } System.out.println("Final Result = " + sum); return sum;
} }
package cs520.hw6.part1;
public class Test {
public static void main(String[] args) {
// creating shared results object SharedResults sr = new SharedResults();
// creating five long task objects LongTask lt1 = new LongTask(sr,1,100); lt1.run(); // starting object as it is created LongTask lt2 = new LongTask(sr,101,200); lt2.run(); LongTask lt3 = new LongTask(sr,201,300); lt3.run(); LongTask lt4 = new LongTask(sr,301,400); lt4.run(); LongTask lt5 = new LongTask(sr,401,500); lt5.run();
// printing results SharedResults.getResult(); }
}
|
|
|
|
 | this is the one which i wrote but something is wrong
|
|
|
|
 | Member 12486776 wrote: but something is wrong It would help if you provided full details of what that something is.
|
|
|
|