Rayj Posted August 5, 2015 Share Posted August 5, 2015 Ok I am outputting some graphics using PIXI. Looks fine. However if I add a simple document.write("Got Here!"); I see the Got Here, but the PIXI output disappears? Any idea why? Ray Quote Link to comment Share on other sites More sharing options...
xerver Posted August 5, 2015 Share Posted August 5, 2015 Nope! Any errors in console? That would likely break your JS and make the loop stop. If you are using XHTML, document.write is invalid. Quote Link to comment Share on other sites More sharing options...
Rayj Posted August 5, 2015 Author Share Posted August 5, 2015 Nope! Any errors in console? That would likely break your JS and make the loop stop. If you are using XHTML, document.write is invalid. I am not seeing a single thing in Firebug besides the "Got Here" that prints with each loop iteration?I comment out the document.write and all is well? Weird! Ray Quote Link to comment Share on other sites More sharing options...
Rayj Posted August 5, 2015 Author Share Posted August 5, 2015 All I am trying to do here is output playing cards 2,3,4,........10,J,Q,K,A, of Hearts,For some reason, all I see are two cards, the A of Hearts and the King of Hearts? When I enable the document.write, I see 13 outputs of "Got Here!" but then no cards! Here is my code: for(i=2; i < 15; i++){ loader.add("images/cards_gif/h" + i + ".gif");} loader.load(setup); var table = new PIXI.Sprite.fromImage("images/table.png"); table.x = 300;table.y = 300;stage.addChild(table);//renderer.render(stage);var card = {}; for(i=2; i < 15; i++){//document.write("got here!"); card = new PIXI.Sprite.fromImage("images/cards_gif/h" + i + ".gif"); stage.addChild(card); renderer.render(stage); card.x = card.x + 72; card.y = 0; }; Quote Link to comment Share on other sites More sharing options...
xerver Posted August 6, 2015 Share Posted August 6, 2015 Why are you using document.write and not console.log? Please don't use document.write() if at all possible. As for why it is breaking your app there is no way to know without me running your app in the exact entirety that you are. Quote Link to comment Share on other sites More sharing options...
Rayj Posted August 6, 2015 Author Share Posted August 6, 2015 Why are you using document.write and not console.log? Please don't use document.write() if at all possible. As for why it is breaking your app there is no way to know without me running your app in the exact entirety that you are. Ok but that is not an issue on it's own. Ok, I changed it to console.log and now it runs, but I only see one console.log message? The console.log is inside a loop that should have 13 iterations? Quote Link to comment Share on other sites More sharing options...
Rayj Posted August 6, 2015 Author Share Posted August 6, 2015 Ok but that is not an issue on it's own. Ok, I changed it to console.log and now it runs, but I only see one console.log message? The console.log is inside a loop that should have 13 iterations?Wow....why is a simple console.log acting so weird? I have a console.log right after entering the loop. It only triggers once?GET http://192.168.1.116/ [HTTP/1.1 200 OK 16ms] "Pixi.js 3.0.6 - WebGL - http://www.pixijs.com/" pixi.min.js:7:27113 "got here in loop!" If I add another console.log a little further down but still inside the loop, I get: GET http://192.168.1.116/ [HTTP/1.1 200 OK 12ms] "Pixi.js 3.0.6 - WebGL - http://www.pixijs.com/" pixi.min.js:7:27113 "got here in loop!" 192.168.1.116:52:1"got here after renderer!" 192.168.1.116:56:1"got here in loop!" 192.168.1.116:52:1"got here after renderer!" 192.168.1.116:56:1"got here in loop!" 192.168.1.116:52:1"got here after renderer!" 192.168.1.116:56:1"got here in loop!" 192.168.1.116:52:1"got here after renderer!" 192.168.1.116:56:1"got here in loop!" 192.168.1.116:52:1"got here after renderer!" 192.168.1.116:56:1"got here in loop!" 192.168.1.116:52:1"got here after renderer!" 192.168.1.116:56:1"got here in loop!" 192.168.1.116:52:1"got here after renderer!" 192.168.1.116:56:1"got here in loop!" 192.168.1.116:52:1"got here after renderer!" 192.168.1.116:56:1"got here in loop!" 192.168.1.116:52:1"got here after renderer!" 192.168.1.116:56:1"got here in loop!" 192.168.1.116:52:1"got here after renderer!" 192.168.1.116:56:1"got here in loop!" 192.168.1.116:52:1"got here after renderer!" 192.168.1.116:56:1"got here in loop!" 192.168.1.116:52:1"got here after renderer!" 192.168.1.116:56:1"got here in loop!" 192.168.1.116:52:1"got here after renderer!" Makes no sense to me!!!! Quote Link to comment Share on other sites More sharing options...
xerver Posted August 6, 2015 Share Posted August 6, 2015 Ah I see, you are reading the console wrong. Chrome console stacks identical logs on a single line and puts the number of times it happened next to it on the left. Quote Link to comment Share on other sites More sharing options...
Rayj Posted August 6, 2015 Author Share Posted August 6, 2015 Ah I see, you are reading the console wrong. Chrome console stacks identical logs on a single line and puts the number of times it happened next to it on the left.But I am using Firefox? Quote Link to comment Share on other sites More sharing options...
Rayj Posted August 6, 2015 Author Share Posted August 6, 2015 And I made no changes but I am getting this error: The Web Console logging API (console.log, console.info, console.warn, console.error) has been disabled by a script on this page. Now what? Quote Link to comment Share on other sites More sharing options...
xerver Posted August 6, 2015 Share Posted August 6, 2015 Sounds like the console API was disabled by script on your page. Like I said before: As for why it is breaking your app there is no way to know without me running your app in the exact entirety that you are. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.