@@ -36,7 +36,7 @@ <h1 id='header'>Read A Driver's License <a href="javascript:void(0)" id='readAga
3636 < div class ="resultAlert_title "> Results: < em id ="resultAlert_btn " class ="message_box_closebtn "> < svg viewBox ="0 0 1024 1024 " xmlns ="http://www.w3.org/2000/svg " p-id ="4604 " width ="16 " height ="16 "> < path d ="M512 456.310154L94.247385 38.557538a39.542154 39.542154 0 0 0-55.689847 0 39.266462 39.266462 0 0 0 0 55.689847L456.310154 512 38.557538 929.752615a39.542154 39.542154 0 0 0 0 55.689847 39.266462 39.266462 0 0 0 55.689847 0L512 567.689846l417.752615 417.752616c15.163077 15.163077 40.290462 15.36 55.689847 0a39.266462 39.266462 0 0 0 0-55.689847L567.689846 512 985.442462 94.247385a39.542154 39.542154 0 0 0 0-55.689847 39.266462 39.266462 0 0 0-55.689847 0L512 456.310154z " p-id ="4605 " fill ="#ffffff "> </ path > </ svg > </ em > </ div >
3737 < div id ="resultAlert_content " class ="resultAlert_content "> </ div >
3838 </ div >
39- < script src ="https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@9.2.10 /dist/dbr.js "> </ script >
39+ < script src ="https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@9.0.2 /dist/dbr.js "> </ script >
4040 < script src ="https://cdn.jsdelivr.net/npm/dynamsoft-code-parser@1.1.0/dist/dcp.js "> </ script >
4141 < script >
4242 /** LICENSE ALERT - README
@@ -176,13 +176,21 @@ <h1 id='header'>Read A Driver's License <a href="javascript:void(0)" id='readAga
176176
177177 let parsedDLInfo = await parser . parseData ( text ) ;
178178 let resultShowNode = document . createElement ( "p" ) ;
179- for ( let o in parsedDLInfo ) {
180- resultShowNode . appendChild ( createNode ( "span" , parsedDLInfo [ o ] . description ) ) ;
181- resultShowNode . appendChild ( createNode ( "br" ) ) ;
182- resultShowNode . appendChild ( createNode ( "strong" , parsedDLInfo [ o ] . value ) ) ;
183- resultShowNode . appendChild ( createNode ( "br" ) ) ;
184- resultShowNode . appendChild ( createNode ( "span" , "------------------------------" ) ) ;
185- resultShowNode . appendChild ( createNode ( "br" ) ) ;
179+ let oriParseInfo ;
180+ if ( parsedDLInfo . resultInfo . AAMVADLInfo ) {
181+ oriParseInfo = { ...parsedDLInfo . basicPersonalInfo , jurisdictionVehicleCode : parsedDLInfo . resultInfo . jurisdictionVehicleCode , licenseNo : parsedDLInfo . resultInfo . licenseNo , ...parsedDLInfo . resultInfo . AAMVADLInfo } ;
182+ } else {
183+ oriParseInfo = { ...parsedDLInfo . basicPersonalInfo , ...parsedDLInfo . resultInfo } ;
184+ }
185+ for ( let o in oriParseInfo ) {
186+ if ( oriParseInfo [ o ] ) {
187+ resultShowNode . appendChild ( createNode ( "span" , o ) ) ;
188+ resultShowNode . appendChild ( createNode ( "br" ) ) ;
189+ resultShowNode . appendChild ( createNode ( "strong" , oriParseInfo [ o ] ) ) ;
190+ resultShowNode . appendChild ( createNode ( "br" ) ) ;
191+ resultShowNode . appendChild ( createNode ( "span" , "------------------------------" ) ) ;
192+ resultShowNode . appendChild ( createNode ( "br" ) ) ;
193+ }
186194 }
187195 document . getElementById ( 'resultAlert_content' ) . innerHTML = "" ;
188196 document . getElementById ( 'resultAlert_content' ) . appendChild ( resultShowNode ) ;
0 commit comments