Asked Questions
Views
13
Answers
1
Views
16
Answers
1
Views
10
Answers
1
Views
11
Answers
1
Views
16
Answers
1
Views
12
Answers
1
Views
16
Answers
1
Views
13
Answers
1
Views
13
Answers
1
Views
15
Answers
1
Views
14
Answers
1
Views
12
Answers
1
Views
17
Answers
1
Views
16
Answers
1
Views
14
Answers
1
Views
13
Answers
1
Views
16
Answers
1
Views
14
Answers
1
Views
11
Answers
1
Views
12
Answers
1
Views
16
Answers
1
Views
14
Answers
1
Views
24
Answers
1
Views
16
Answers
1
Views
13
Answers
1
Views
18
Answers
1
Views
20
Answers
1
Views
16
Answers
1
Views
16
Answers
1
Views
22
Answers
1
Views
16
Answers
1
Views
18
Answers
1
Views
19
Answers
1
Views
16
Answers
1
Views
14
Answers
1
Views
23
Answers
1
Views
22
Answers
1
Views
22
Answers
2
Views
19
Answers
1
Views
26
Answers
1
Views
19
Answers
1
Views
16
Answers
1
Views
15
Answers
1
Views
16
Answers
2
Views
37
Answers
2
Views
20
Answers
2
Views
21
Answers
1
Views
15
Answers
1
Views
16
Answers
1

I think my question is a little bit more complicated than what I saw on the internet because I need to make multiple filtrations on a single table. So here\'s my code:

 

Views
36
Answers
0

I have Restful API service in asp.net, which provides code for JavaScript to use, i need to use its functions in angular. I am posting code here which has RestAPI function and it includes calls to data and it should return JSON data to calling function i believe. please if anybody familiar with the solution your response will be highly appreciated. Thank-you.

function RestAPI(){ self = this; }
RestAPI.prototype = {
    self: null,
    urlString: \"http://exclusiveautosales.azurewebsites.net/ExclusiveAutoSales_Handler.ashx\",
    GetFiltersMain:function(successFunction,failFunction,token) {
        var data = { \'interface\': \'RestAPI\', \'method\': \'GetFiltersMain\', \'parameters\': {}, \'token\': token };
        var jsonData = dojo.toJson(data);
        var xhrArgs = {
            url: self.urlString,
            handleAs: \'json\',
            postData: jsonData,
            load: successFunction,
            error: failFunction };
        var deferred = dojo.xhrPost(xhrArgs);
    },
    GetMakeModelPrice:function(make_id,model_id,min_price,max_price,successFunction,failFunction,token) {
        var data = { \'interface\': \'RestAPI\', \'method\': \'GetMakeModelPrice\', \'parameters\': {\'make_id\':make_id,\'model_id\':model_id,\'min_price\':min_price,\'max_price\':max_price}, \'token\': token };

        var jsonData = dojo.toJson(data);
        var xhrArgs = {
            url: self.urlString,
            handleAs: \'json\',
            postData: jsonData,
            load: successFunction,
            error: failFunction };
        var deferred = dojo.xhrPost(xhrArgs);
    },
    GetSearchResult:function(search_q,make_id,model_id,year_id,engine_id,color_id,body_id,transmission_id,fueltype_id,subfeature_id,minPrice,maxPrice,successFunction,failFunction,token) 
Views
26
Answers
0
Views
29
Answers
0

I have a function where I check my two (or one) input fileds if they are empty i want to let\'s say print alert in window but if they have vaules i want to run else but in my case alert is not popping up and if i want to submit those two fileds with data it is ok pushing it and doing alll stuff in else but whole browser is reloading. I was trying to add prevent.Default() but not working. Or return false

UPDATE: I made some changes and know when input is empty alert is popping up, but when i colse it it is still realoding whole page, same thing if else is executed all browser is reloading

 let pushBtn = document.getElementById(\'push-btn\');

pushBtn.addEventListener(\'click\', pushData);


 function pushData() {

let deviceVal = document.getElementById(\'device\').value;
let powerVal = document.getElementById(\'power\').value;

if (deviceVal != \'\' || powerVal != \'\') {
    let list = document.getElementById(\'list-group\')
    let button = document.createElement(\'button\');
    let ul = document.createElement(\'ul\');
    let liFirst = document.createElement(\'li\');
    let liSecond = document.createElement(\'li\');
    let liThird = document.createElement(\'li\');

    button.classList.add(\"list-group-item\");
    ul.classList.add(\"desc\");
    liFirst.classList.add(\"t-desc\");
    liSecond.classList.add(\"t-desc2\");
    liThird.classList.add(\"t-desc3\");
    liFirst.textContent = deviceVal;
    liSecond.textContent = powerVal;
    liThird.innerHTML = `<label class=\"switch\">
        <input type=\"checkbox\">
        <span class=\"slider round\"></span>
      </label>`
    modal.style.display = \'none\';
    ul.append(liFirst);
    ul.append(liSecond);
    ul.append(liThird);
    button.append(ul);

    list.prepend(button);



} else {
    alert(\'aaa\');
    return false

}

}

Views
23
Answers
1
Views
29
Answers
0
Views
29
Answers
0
Views
44
Answers
0
Views
27
Answers
0
Views
26
Answers
0