Welcome Guest Search | Active Topics | Sign In | Register

Javascript with Parameters just does not work. Options
Darkenn
Posted: Sunday, October 8, 2017 11:51:20 AM
Rank: Newbie
Groups: Member

Joined: 10/8/2017
Posts: 1
This is what I have.
Code: C#
private void webView2_LoadCompleted(object sender, EO.WebBrowser.LoadCompletedEventArgs e)
        {
           
            if (buynow == true)
            {
                webView2.EvalScript(string.Format(@"
                searchResults = document.getElementById('searchResultsRows').children;
                listing = searchResults[1].children; block = listing[1].children;
                price = block[1].children;  value = price[0].children;
                realprice = ((value[0].innerText).trim()).replace('€', '');
                if (realprice <= {0}) {
                    buttons = block[0].children;
                    buy_button = buttons[0].children;
                    buy_button[0].click();
                    document.getElementById('market_buynow_dialog_accept_ssa').click();
                    document.getElementById('market_buynow_dialog_purchase').click();
                    alert('Bought!') 
                } 
                else{alert('Too Late!');}"
                , buywhen_tb.Text));
               
            }
        }


This gets some kind of String.Format Error, but what is wrong?
eo_support
Posted: Sunday, October 8, 2017 1:01:27 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,225
Thanks for posting in the support forum. This is just to let you know that our support does not troubleshoot such errors because its about formatting a string, which is a generic programming issues that can occur anywhere with or without our product. As a general rule, we do not provide support on generic programming issues to avoid abuse. Hope you understand.


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.