BookstoreWeb/Scripts/BookPurchase.js
// Prints the book metadata to the page.
Prints the book metadata to the page.
Prints the book metadata to the page .
function successGetBookMetadata(data) {
    var jsonObject = JSON.parse(data.body);
    var bookTitle = jsonObject.d.Name.split(".")[0];
    var bookPrice = jsonObject.d.Length / 1024;
    document.getElementById("lblBookTitle").innerText =
        bookTitle;
    document.getElementById("lblBookPrice").innerText =
        "$ " + bookPrice.toFixed(2);
    $("#lnkBuy").show();
}
function successGetBookMetadata ( data ) { var jsonObject = JSON . parse ( data . body ) ; var bookTitle = jsonObject . d . Name . split ( "." ) [ 0 ] ; var bookPrice = jsonObject . d . Length / 1024 ; document . getElementById ( "lblBookTitle" ) . innerText = bookTitle ; document . getElementById ( "lblBookPrice" ) . innerText = "$ " + bookPrice . toFixed ( 2 ) ; $ ( "#lnkBuy" ) . show ( ) ; }
Prints the book metadata to the page.
Prints the book metadata to the page .
//Render the title and price in the placeholders