ajax update using jQuery to external file

Hi,

I have this within a file called 'product-scores.php' but I want to update the innerHTML of another file (on the same server) like so:

...$('admin_includes/ajax.htm#get_percent_conds_actives').text(data.active_ids+' ').show(1);

View the other code too. Can I do this? How do I check that this ajax.htm file was updated. I'm familiar with firebug but I don't know how to check another external file if it's possible for the ajax update. As well, I don't think that code seems to work but I can't check if the code is updated or not.

Thanks,
Victor
$.ajax({
            type : 'POST',
            url : 'get_selected_product_info.php',
            dataType : 'json',
            data: {
                product_id : prod_id,
                product_type_id : product_type_id
            },
            success : function(data){
                $('#display_selected_product_info').html(data.display_product_info).show(500);
                var cntActiveIds = data.active_ids.length;
                
                $('admin_includes/ajax.htm#get_percent_conds_actives').text(data.active_ids+' ').show(1);
            },
            error : function(XMLHttpRequest, textStatus, errorThrown) {
                $('#display_selected_product_info').text(textStatus).show(500);
            }
        });

Open in new window

Victor KimuraSEO, Web DeveloperAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Terry_focusCommented:
Hi,

You can not use JavaScript/jquery to update files, you'll have to add another php file to update the actual text in another file. JavaScript is client side only and can not interact with files on the server other than AJAX requests, which only fetch data.

If you are trying to update another window in the browser, you can do this by changing the context of the jQuery selector to that of the other window
http://api.jquery.com/jQuery/
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Victor KimuraSEO, Web DeveloperAuthor Commented:
Hi,

Thanks for that info. I'm wondering if you know of an example of how I can update the context of another window using the jQuery selector. I browsed the site but didn't see an actual example to select another window. Just curious for future use.

Thanks,
Victor
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
JavaScript

From novice to tech pro — start learning today.