0

i tried framework7 Custom DOM library and i run one of the example

$$.ajax({
  url: 'somepage.html',
  statusCode: {
    404: function (xhr) {
      alert('page not found');
    }
  }
})

but it return error in the console

Uncaught TypeError: $$.ajax is not a function
    at HTMLAnchorElement.<anonymous> (app.js:11)
    at HTMLAnchorElement.handleEvent (framework7.js:967)
    at sendClick (framework7.js:3589)
    at Framework7.handleTouchEnd (framework7.js:3779)
    at framework7.js:2619
    at Array.forEach (<anonymous>)
    at framework7.js:2618
    at Array.forEach (<anonymous>)
    at Framework7.emit (framework7.js:2616)
    at emitAppTouchEvent (framework7.js:3856)

does anyone know how to use Dom7 Custom Library ?

i already tried to Export DOM7 to local variable to make it easy accessable

var $$ = Dom7;

i also tried to include Dom7.js in my script

<script src="node_modules/dom7/dist/dom7.js"></script>
gymie
  • 1
  • 2

1 Answers1

0

Got it working right now

In v2 it is myApp.request({...})

`var xhr =app.request({

    method: method,
    url: url,
    contentType: contentType,
    crossDomain: true,
    data: data,
    beforeSend: function (xhr) {

        form.trigger('beforeSubmit', {data:data, xhr: xhr});
    },
    error: function (xhr) {
        form.trigger('submitError', {data:data, xhr: xhr});
    },
    success: function (data) {
        form.trigger('submitted', {data: data, xhr: xhr});

        }, 2000);




    }
});`
Okechukwu Eze
  • 155
  • 1
  • 14