- 0
Ajax w/ jQuery in external js file...and one other thing
-
Recently Browsing 0 members
- No registered users viewing this page.
-
Posts
-
By seta-san · Posted
Don’t care about a wrestling union. No normal person should care. -
By naap51stang · Posted
Limassol, Cyprus. Just south of Turkey. NOT Russia. -
By goretsky · Posted
Hello, Given the reports of Chinese Mini PCs shipping with malware, I would recommend wiping the machine and performing a clean install of Windows on it before use. From what I can infer from the reports, the Mini PCs that shipped with malware were not the result of targeted purposeful action on the part of the device manufacturers (which is something that has happened with low-cost Android smartphones and TV boxes from China) but rather due to lax security in the manufacturing process. Getting back to the subject at hand, there are a few steps you will want to go through before wiping the Mini PC: You can start preparing even before the Mini PC arrives. Once you have ordered it and know the brand and model, go to the manufacturer's website and download all of the latest device drivers, BIOS (UEFI) firmware updates, machine-specific software (if any), and manuals. Many Mini PC manufacturers do not do a lot of customization of their device drivers, just shipping whatever device drivers the the silicon vendors provide. I still recommend downloading them, though, just in case there are some customizations or for initial install since those are the drivers you know the manufacturer validated for the Mini PC. Store these in a safe place, so you have them ready when the Mini PC arrives. Use Microsoft's Windows Media Creation Tool to create an installation USB. You can also create a directory on installation USB--like C:\DRIVERS\ or whatnot--and store the extracted device drivers there in case you need them while or after installing Windows. Once the Mini PC arrives, and you have your Windows installation USB available, you can proceed with wiping the PC and doing the clean install. Here's how you do that, step-by-step: Check the computer and make sure you know how to boot it from a USB flash drive (may be a specific key you have to press when the computer is powered on, or a change to the BIOS (UEFI) firmware settings. The PC may tell you what key combination you need to press to boot from another drive, or the manual for the PC may it. Plug the USB flash drive into the computer and power it up using the means to have it boot from the Windows install USB. Once the computer finishes booting, it should be at a Windows installation screen. Do not agree to any prompts, copyright licenses, or click on any buttons. Press the Shift + F10 keys together to open a Command Prompt. Run DISKPART to start the command-line disk partitioning utility. The command line prompt will change to DISKPART>. At the DISKPART> prompt, type LIST DISK to get the numbers of all drives installed in the system. Make a note of what number is assigned to what drive (if the Mini PC has more than one drive). At the DISKPART> prompt, type SEL DISK n where n is the number of the drive containing Windows. At the DISKPART> prompt, type CLEAN and this will erase the GPT/MBR code from the beginning of the drive. *WARNING:* After performing the clean operation, the drive now be blank/erased, and everything on it will be gone (all files, etc.). You can exit DiskPart and just continue with the Windows installation as you normally would. If needed, you can install the device drivers you put on the Windows install media to get your network connection up and running, and from there run Windows Update to get the operating system and device drivers up to date Regards, Aryeh Goretsky -
By pmrd · Posted
Why? Amazon has some great shows and Fallout was near perfect. -
-
-
Recent Achievements
-
cac1lll earned a badge
Week One Done
-
Falcon.ai earned a badge
One Month Later
-
Falcon.ai earned a badge
Week One Done
-
EYEREX earned a badge
Dedicated
-
Electronic Person earned a badge
First Post
-
-
Popular Contributors
-
Tell a friend
Question
firey
So, I've been doing more and more web-development. I have fairly strong PHP, HTML, ASP, jQuery, etc experience.. but I'm not sure the best way to manage something. Now, I come from a very object oriented way of programming and the use of multi-use functions so maybe this is what is messing me up.
So.. say I have an ajax function that runs a get on a php page, and I return an array of results from the database in json format. In some cases I may want that array dumped into a table.. but in other cases I may want it in a drop down list.
Now.. I know I could do it a couple of ways..
1) Have the function to fill the table of data in one page, then have the same function except filling a drop down in another page. I don't like this because I have the same AJAX code in two spots, the only difference being the result of the success.
2) Have a function that runs the ajax which then takes a callback to a function which is run on success. The problem with this is that some callbacks may have more parameters than other callbacks so not sure how to make that clean per-se.
3) Have a function that runs the ajax and takes a bunch of parameters then based on those parameters do different things in the success/fail.
4) Not have all sorts of parameters, and make the ajax return the data on success.. but would have to not make it async or my data would come back after my calling function has been executed.
Is there a better way of doing it, or a preferred way?
Also, in ASP I can do like sections where certain data appears on the page based on the content ID. How can I do something like that in PHP. Right now I have all my scripts being loaded in the head.. but would like them at the bottom of the body.. but I would need them BEFORE any per-page inline scripts. Without having an include in each php page telling it to include the scripts.. or putting them in script to be run.. how would I do that?
Link to comment
https://www.neowin.net/forum/topic/1248978-ajax-w-jquery-in-external-js-fileand-one-other-thing/Share on other sites
0 answers to this question
Recommended Posts