bodyに書き込んでおいてそれを呼び出すとか。
HTML
1<body data-ajax="show.php"></body>
JavaScript
1var callphp = $( 'body' ).attr( 'data-ajax' );
2if ( callphp ) {
3 $.get( callphp, {
4 name : $( '#id' ).val()
5 }, function( data ){
6 $( '#result' ).html( data.message + '次へ進む' );
7 });
8}
追記:
JavaScript
1var callphp; // グローバルにしたいならここで。
2var button_id;
3$( function() { // DOM構築を待つ
4 callphp = $( 'body' ).attr( 'data-ajax' );
5 console.log( 'callphp:',callphp );
6 button_id = $( 'body' ).attr( 'button-id' );
7 console.log( 'button_id:',button_id );
8} );
2016/09/18 11:34
2016/09/18 11:37
2016/09/18 12:55