Transmitting extensions via AJAX

I am having trouble sending navigator plugins with AJAX as I am only getting one plugin in the result.

The plugin list currently shows: Shockwave Flash. However, it should display like this: Shockwave Flash - Chrome Remote Desktop Viewer - Native Client...

<script>
for (var myIndex = 0; myIndex < navigator.plugins.length; myIndex++) {
    var blabla = (navigator.plugins[myIndex].name);
}
$.ajax({
    type: 'POST',
    url: 'save.php',
    cache: false,
    data: {
        pluginlist: blabla,
    },
});  
</script>

What could be causing this issue?

Additionally, when testing the script, it appears to work correctly.

<SCRIPT>
for (var myIndex=0; myIndex<navigator.plugins.length; myIndex++) {
    document.write(navigator.plugins[myIndex].name, " - ");
}
</SCRIPT>

Answer №1

Experiment with populating an array with data:

let arrayData = [];
for (let index = 0; index < navigator.plugins.length; index++) {
    arrayData.push(navigator.plugins[index].name);
}

Currently, each loop iteration overwrites the existing values in arrayData. As a result, only one plugin name is being collected.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

An alternative to PHP's exec function in Node.js

I am interested in developing a piece of software using C (such as prime number factorization) and hosting it on my web server with Node.js. Following that, I would like to create an HTML document containing a form and a button. Upon clicking the button, ...

Iterate through the xml.documentElement in a loop

I want to show 8 men and 2 women in SVG format. However, my current function only displays one man and woman. How can I add a loop to make this work for all individuals? for (i = 0; i < Serie[n].Number; i++) { return xml.documentElement } The data arr ...

What exactly does the next() function do in NodeJS/SailsJS?

I recently came across a SailsJS tutorial where the next(); function was used for user authentication. However, I'm still unsure of its exact purpose. Can anyone provide clarification on this? ...

How can I extract the text within an element based on the position of the

In my current project, I have incorporated the incredibly useful jQuery TextRange plugin. Within a highlight div positioned above a textarea element, it is crucial for me to identify the specific element that the user is currently editing. To better illust ...

Determine the DOM element that corresponds to a right-click action

I utilized the code snippet below to construct a personalized context menu: <script type="text/javascript"> $(document).ready(function() { var x, y; document.oncontextmenu = function(e) { e.preventDefault(); x = e.clientX; ...

Load the AJAX-enabled guestbook into the designated DIV element

I have been trying to incorporate a dynamic guestbook into my web page using a DIV tag. I attempted to load the guestbook using the following code: $(document).ready(function() { $('.diskusia').click(function () { $("#disk").load("diskusia/index ...

Guide to using Angular $resource to pass query parameter array

My goal is to implement a feature that allows users to be searched based on multiple tags (an array of tags) using the specified structure: GET '/tags/users?tag[]=test&tag[]=sample' I have managed to make this work on my node server and hav ...

Is there a way to use Regex to strip the Authorization header from the logging output

After a recent discovery, I have come to realize that we are inadvertently logging the Authorization headers in our production log drain. Here is an example of what the output looks like: {"response":{"status":"rejected",&quo ...

Troubleshooting: Laravel 5.6 Ajax Jquery Modal data submission issue in Database

As a beginner with Laravel 5.6 and using Ajax for CRUD operations in the Database, I am facing an issue with inserting data from my modal. Despite changing the default "id" to "asset_category_id" in the migration file and protecting it in the Model Class, ...

Enhance user experience with Angular Material and TypeScript by implementing an auto-complete feature that allows

Currently facing an issue with my code where creating a new chip triggers the label model to generate a name and ID. The problem arises when trying to select an option from the dropdown menu. Instead of returning the label name, it returns an Object. The ...

Error occurred when sending form data while uploading a file

Upon trying to upload a file using the formData.append(key, value);, an error message is displayed in the value section: The argument of type 'unknown' cannot be assigned to a parameter of type 'string | Blob'. Type '{}' is ...

Looking to construct dynamic checkboxes in Angular by parsing a JSON object retrieved through AJAX

I have a JSON document structured like the example below, and I am looking to generate checkboxes dynamically using Angular. let data = { "Name":[ { "tagId":4489,"name":"Name","label":"Employee Name" } ], "Service":[ { "tagId": ...

Setting response query correctly in Solr using AJAX

Inspired by an example of using Solr's JSON output for AJAX, I have incorporated a drop-down menu into my project form and introduced faceting to the parameters. Parameters: function getstandardargs() { var params = [ 'wt=json' ...

Using SignalR for lengthy processes: transmitting progress updates

Utilizing SignalR to initiate lengthy computations on the server and notify the client when the results are ready. The input bindings consist of an HTTP request. Desire to send multiple messages to update the client on various stages of the process (e.g., ...

What is the simplest method for displaying a "loading" indicator while utilizing jQuery's AJAX functionality?

Is there an efficient method to display a 'loading' gif for a specific jquery ajax request? I've attempted: $(document).ajaxStart(function() { $('.hideOnLoad').hide(); }); $(document).ajaxStop(function() { $('.hideOn ...

What is the best way to implement Ajax in Rails 3.1?

It's common knowledge that Rails 3.1 utilizes CoffeeScript and JQuery. In the past, I would handle AJAX requests by responding to a template named some_action.js.erb Now with CoffeeScript available, I want my templates to be able to use CoffeeScript ...

When there is content behind the list, the Autosuggest Ajax does not function properly

I have successfully implemented an ajax/jquery dropdown/list feature that retrieves results from the database based on user input. For each result in the database, it generates a <li> element and converts it into a clickable link to redirect users t ...

The Quirks of jQuery's .load() Method

On my website, I am incorporating a basic jQuery script to load content from one part of a webpage into the 'display container' on the same page. The content being loaded consists of multiple divs enclosed within an outer <div> that is hid ...

vue implementing autoscroll for long lists

I am looking to implement an autoscrolling log feature on my webpage that is dynamically fetched from a REST endpoint. To handle the potentially large size of this log, I decided to use vue-virtual-scroll-list. Additionally, I wanted the log to automatical ...

How can I retrieve the index of a v-for loop within a function in Vue.js HTML?

How can I splice the array from the fields in HTML Vue JS if the status is true? I also need to pass the index value to a function. Is this possible? The error I am encountering is: Uncaught ReferenceError: index is not defined at Object.success (80 ...